Capital gains on a home sale (Section 121)
When you sell your main home, the IRS Section 121 exclusion lets you exclude up to $250,000 of capital gain ($500,000 if married filing jointly) from tax - if you owned and lived in the home for at least 2 of the last 5 years. Gain above the exclusion is taxed at long-term capital gains rates (0/15/20% plus the 3.8% NIIT for high earners). The exclusion does not apply to second homes or rentals. General information, not tax advice.
Source: IRS Topic No. 701, Sale of Your Home. Data as of June 2026.
The exclusion at a glance
| Situation | Maximum gain excluded |
|---|---|
| Single filer (main home, 2-of-5 test met) | $250,000 |
| Married filing jointly (both meet the use test) | $500,000 |
| Second home / vacation home | $0 (fully taxable) |
| Rental property | $0 (taxable + depreciation recapture up to 25%) |
How to calculate the taxable gain
Start with the sale price, subtract selling costs and your cost basis (purchase price plus capital improvements) to get the gain. Then subtract the Section 121 exclusion you qualify for. Only the remainder is a taxable long-term capital gain. Example: a couple with a $700,000 gain on their main home excludes $500,000, leaving $200,000 taxed at long-term rates (and possibly the 3.8% NIIT). Your state may tax the remaining gain too.
Frequently asked questions
How much capital gains can I exclude when I sell my home?
Under Section 121, you can exclude up to $250,000 of gain ($500,000 if married filing jointly) on the sale of your main home, if you owned and used it as your principal residence for at least 2 of the last 5 years. Gain above the exclusion is taxed at long-term capital gains rates.
What is the 2-out-of-5-year rule?
To claim the full Section 121 exclusion you must have owned the home and lived in it as your main home for at least 24 months (they need not be continuous) during the 5-year period ending on the sale date. You generally cannot use the full exclusion more than once every two years.
Is the home-sale exclusion subject to the 3.8% NIIT?
Gain you exclude under Section 121 is not net investment income, so the excluded portion is not subject to the 3.8% NIIT. Any taxable gain above the exclusion can be, if your income is over the NIIT threshold.
Does the exclusion apply to a rental or second home?
No. The exclusion is only for your main home. Gains on second homes, vacation homes and rental property are fully taxable at capital gains rates, and rentals also face depreciation recapture (taxed up to 25% as unrecaptured Section 1250 gain).
Related
- Collectibles 28% & unrecaptured Section 1250 25%
- Long-term capital gains brackets
- Guide: capital gains on selling a house
Source: IRS Topic No. 701, Sale of Your Home. Not tax advice.
Last updated: 2026-06-21