The exclusion, in Section 121 of the tax code, is why most people who sell their main home owe no federal capital gains tax. It applies to your gain, not the sale price, so the first step is working out what
Who qualifies for the exclusion?
IRS Publication 523 sets two tests. Ownership: you owned the home for at least 24 months of the 5 years before the sale. Use: you lived in it as your main home for at least 24 months of those 5 years. The months don’t have to be in one block, and the ownership and use periods don’t have to be
You also can’t have used the exclusion on another home sale in the 2 years before this one. A married couple filing jointly can exclude up to $500,000 when one or both spouses meet the ownership test and both meet the use test and
If you sold early because of a job move, a health reason or an unforeseeable event, like a death or divorce, you may still qualify for
How do you figure the gain?
Start with the sale price and subtract selling expenses, like commissions and legal fees, to get the amount realized. Then subtract your adjusted basis: what you paid for the home, plus certain buying costs and the cost of improvements such as a new roof, an addition or a kitchen remodel. Repairs like
Do you have to report the sale?
You must report the sale if you received Form 1099-S or if you can’t exclude all of the gain; otherwise you generally don’t need to. A 1099-S means reporting even when the gain is fully excluded. Any gain above the limit is reported as
A loss on the sale of your main
What reduces or blocks the exclusion?
Time after 2008 when the home wasn’t your main home, such as years as a rental, can reduce the exclusion. Depreciation you claimed for a home office or rental after May 6, 1997 is taxable even if the rest of the gain is excluded. Investment property doesn’t qualify at all; for that, a 1031 exchange may
Example: figuring the taxable gain
| Sale price | $650,000 |
|---|---|
| Selling expenses | −$40,000 |
| Amount realized | $610,000 |
| Adjusted basis (purchase price plus improvements) | −$280,000 |
| Gain | $330,000 |
| Taxable after the $250,000 exclusion (single) | $80,000 |
| Taxable after the $500,000 exclusion (married filing jointly) | $0 |
Illustrative numbers: bought for $250,000, $30,000 of improvements, owned and lived in for more than 2 years. Gain above the exclusion is taxed at long-term capital gains rates when you’ve owned the home more
Common mistakes
- Applying the exclusion to the sale price instead
of the gain. - Forgetting to add improvements to your basis. Keep the receipts for as long as you
own the home. - Assuming a second home or rental qualifies. Only a main home does, and rental years can
shrink the exclusion. - Selling two homes within 2 years and expecting to exclude the
gain on both.
Questions
Do I have to buy another home to use the exclusion?
No. The exclusion has no reinvestment requirement; you can sell and rent, downsize
What if I lived in the home less than 2 years?
You may qualify for a partial exclusion if you sold because of a change in work location, health or certain unforeseeable events. IRS Publication 523 has a worksheet
Does the exclusion apply to state income tax?
Publication 523 covers federal tax only, and state rules can differ. Check your state’s rules or ask a tax professional
Sources
- IRS Publication 523: Selling your home
- IRS Topic 701: Sale of your home
- IRS Topic 409: Capital gains and losses
- IRS: Instructions for Form 1099-S
Written and checked by the Broker & Agent team on October 2, 2026. General information, not legal, tax or lending advice. Something out of date? Tell us.