Primary residences are exempt from the capital gains tax up to a specific value based on your tax filing status. Individual taxpayers are exempt up to $250,000, and joint taxpayers are exempt up to $500,000. Any capital gains beyond these limits are subject to taxation.
For example, if you buy a home as a single adult for $150,000 and it appreciates to $400,000 in 15 years, the capital gains are $250,000. If you sell the house for $400,000, the first $150,00 of appreciation is exempt, but you will have to pay taxes on the remaining $100,000 appreciation.