Selling Your Home: The $250,000 / $500,000 Exclusion Explained

When you sell your main home, you may be able to exclude up to $250,000 of gain from your income, or up to $500,000 on a joint return. For most of the country, that covers the whole profit. In the Bay Area, where many long-time owners have gains well beyond those figures, the details decide how much tax you pay.
1. The Basic Rule
To exclude the gain, you must pass two tests during the five years ending on the sale date:
- Ownership test: you owned the home for at least two years (24 months).
- Use test: you lived in it as your main home for at least two years.
The two years do not need to be continuous, and the ownership and use periods can be different two-year periods.
For the $500,000 joint exclusion: either spouse can meet the ownership test, but both must meet the use test.
One more limit: you generally cannot use the exclusion if you excluded gain on another home sale within the two years before this sale.
2. Your Gain Is Not Sale Price Minus Purchase Price
Your gain is the selling price, minus selling expenses, minus your adjusted basis. A higher basis means a smaller gain.
What raises your basis:
- The original purchase price and certain closing costs
- Improvements that add value or extend the home’s life: a remodeled kitchen, a new roof, an addition, solar panels, landscaping, new windows
What does not:
- Repairs and maintenance, such as repainting or fixing a leak
Bay Area Consideration:
With gains this large, your improvement records are worth real money. If you have owned for twenty years and spent $150,000 on a remodel, that is $150,000 less gain. Gather permits, contractor invoices and closing statements before you list.
3. If Your Gain Is Over the Limit
Gain above the exclusion is taxed as a long-term capital gain if you owned the home more than a year. Depending on your income, the 3.8% net investment income tax may also apply to that portion.
California is different: the state generally allows the same exclusion, but it taxes whatever gain remains at ordinary income rates. California has no lower rate for capital gains.
4. Sold Before Two Years? You May Get a Partial Exclusion
If you do not meet the two-year tests, you may still qualify for a partial exclusion when the main reason for the sale is:
- A work-related move: generally a new job at least 50 miles farther from the home than your old one was
- Health: to obtain or provide medical care for yourself or a family member
- An unforeseeable event: such as divorce, a death, or becoming eligible for unemployment
The partial exclusion is prorated. Live there 12 of the required 24 months and you can generally exclude up to half the maximum.
5. Rented It Out or Had a Home Office?
Two rules catch people who rented the home at some point.
Depreciation is taxed. Any depreciation you claimed, or could have claimed, after May 6, 1997 cannot be excluded. That part of the gain is taxable when you sell.
Nonqualified use reduces the exclusion. If the home was a rental or second home before you lived in it as your main home (for periods after 2008), part of the gain is allocated to that time and cannot be excluded.
Tip:
Renting the home after you move out is treated more favorably, as long as you sell within the five-year window and still meet the two-year tests. If you are thinking about keeping your old home as a rental, watch the calendar: three years after you move out, the use test fails.
6. Surviving Spouses
If your spouse has died and you have not remarried, you can still use the $500,000 exclusion if you sell within two years of the date of death and the other requirements were met immediately before the death.
Bay Area Consideration:
Your basis usually goes up when a spouse dies. The late spouse’s share of the home is reset to its value at the date of death, and in a community property state like California, the basis of the entire home is generally reset if it was community property. That alone can remove most of the gain. California’s own exclusion rule for surviving spouses differs from the federal one, so check the state side before you sell.
7. Do You Have to Report the Sale?
- Yes, if you receive Form 1099-S, even if the entire gain is excluded.
- Yes, if any part of the gain is taxable.
- Reportable sales go on Form 8949 and Schedule D.
A loss on the sale of your main home is not deductible.
Final Thoughts
The home sale exclusion is one of the most generous rules in the tax code, but it is not automatic. The timing of the sale, how the home was used, and how well you documented improvements can each move the tax bill by tens of thousands of dollars. If you are planning to sell, talk to us before you list, not after closing.
Sources: IRS Tax Topic 701, Sale of Your Home; IRS Publication 523, Selling Your Home; 2025 California Schedule CA (540) instructions.
Want a second pair of eyes on your return?
We check every return for credits and deductions like these.
Published November 11, 2026. Tax rules and dollar limits change from year to year, so confirm the figures for the year you are filing.


