The Section 121 home sale exclusion: up to $500,000 of gain the IRS lets you keep
TL;DR: If you owned and lived in your main home for at least 24 months of the 5 years before selling, you can generally exclude up to $250,000 of gain ($500,000 for most married couples filing jointly), once every two years. Rental periods before you move in can shrink the exclusion, and depreciation taken after May 6, 1997 is never excluded.
Educational only, not tax, legal, or investment advice. Examples are illustrations, not predictions. Rules and limits change; verify current figures and talk to a qualified professional about your situation.
Somewhere a homeowner is about to downsize, sell a paid-off house in a hot market, and move somewhere cheaper. Somewhere else a Section 121 exclusion is quietly waiting to save them a five- or six-figure tax bill, provided they lived in the house long enough and didn't get creative with a rental in the middle.
For FIRE households, this rule shows up all the time: selling the high-cost-of-living home to fund early retirement, house hacking and then moving out, or turning an old home into a rental. Here's how it works, per IRS Publication 523 and Topic 701, as of Oct 2026.
CPA Warning Label: The exclusion is generous, but it's built from dates. Keep closing statements, move-in and move-out evidence, and improvement receipts, because "I'm pretty sure it was two years" is not a document.
Ownership and use tests
To claim the full exclusion, you generally need to meet two tests during the 5-year period ending on the date of sale:
- Ownership: you owned the home for at least 24 months (2 years).
- Use: you lived in it as your main home for at least 24 months.
The 24 months don't have to be consecutive, and the two tests don't have to cover the same period. You could rent a place for two years, buy it, live elsewhere for a year, and still qualify, depending on the dates.
| Filing status | Maximum exclusion |
|---|---|
| Single, head of household, married filing separately (per person) | $250,000 |
| Married filing jointly (both meet use, at least one meets ownership, neither excluded a sale in prior 2 years) | $500,000 |
Other key points:
- You generally can't use the exclusion if you excluded gain on another home sale within the 2 years before this sale.
- Members of the uniformed services and Foreign Service, intelligence community employees, and certain others on qualified official extended duty can elect to suspend the 5-year period for up to 10 years.
- Gain above the exclusion is a capital gain, taxed at long-term rates if you owned the home for more than a year. If you received a Form 1099-S, report the sale on Form 8949 and Schedule D even if the full gain is excluded.
- Excluded home sale gain isn't subject to the 3.8% net investment income tax. Taxable gain above the exclusion can be. See the NIIT guide.
Partial exclusion
Didn't make it to 24 months? You may still get part of the exclusion if the main reason for selling was a change in place of employment, health, or certain unforeseen circumstances, as defined in IRS rules and Publication 523. The partial exclusion is generally prorated by how much of the 2-year requirement you met.
Illustration: A single filer lives in a home for 12 months and then takes a qualifying job in another state. Twelve of twenty-four months is 50%, so the maximum exclusion would be about 50% of $250,000, or $125,000. If the gain is $90,000, all of it would be excluded. The sale doesn't have to be perfectly timed, but it does have to fit one of the recognized reasons. "We were bored of the kitchen" is not one of them, no matter how bad the kitchen is.
Pub 523 includes worksheets and safe harbors for each category. Read them before assuming you qualify.
Rental conversion rules
The FIRE classic: buy a home, rent it out for a while, move in for two years, sell, and exclude everything. Congress noticed. Since 2009, gain allocated to periods of nonqualified use, meaning time when neither you nor your spouse used the property as a main home, generally can't be excluded. The excluded portion is prorated by the ratio of nonqualified use to total ownership.
But there's an important exception that works in the other direction: time after your last day of living in the home, within the 5-year window, is not counted as nonqualified use. So the order matters a lot:
| Sequence | Typical result |
|---|---|
| Live in it 2+ years, move out, rent it, sell within 3 years of moving out | Ownership and use tests met; rental period after moving out isn't nonqualified use. Exclusion available, minus depreciation (below). |
| Rent it out first, then move in for 2 years, then sell | Earlier rental years are nonqualified use; part of the gain is taxable. |
| Live in it 2 years, rent it for 4, sell | Use test fails in the 5-year window. No exclusion; the gain is taxable (consider a 1031 instead). |
A home you acquired through a 1031 exchange comes with extra Section 121 restrictions, and when a former home is later exchanged, Pub 523 explains how the exclusion is applied before the 1031 deferral. Check the current rules before you plan a move-in. See 1031 exchange basics.
Depreciation recapture
If you rented out the home or used part of it for business, any depreciation allowed or allowable for periods after May 6, 1997 can't be excluded, even when the rest of the gain is. That portion is generally taxed as unrecaptured Section 1250 gain, at a maximum rate of 25%.
The "or allowable" part is the sneaky bit. If you rented the house and never claimed depreciation, the IRS still reduces your basis by the depreciation you were entitled to. Skipping the deduction doesn't skip the recapture; it just means you paid more tax earlier for no reason. See real estate depreciation.
Example
Illustration: A married couple filing jointly bought a house for $400,000 in year 1 and lived in it for 3 years. They moved out and rented it for 2 years, claiming $20,000 of depreciation, then sold it for $950,000 net of selling costs. They put $30,000 of improvements into it over the years.
- Adjusted basis: $400,000 + $30,000 - $20,000 = $410,000
- Gain: $950,000 - $410,000 = $540,000
- Within the 5 years before the sale, they owned it 5 years and lived in it 3, so both tests are met.
- Rental years came after the last use as a home, so they aren't nonqualified use.
- Depreciation portion, not excludable: $20,000 (unrecaptured ยง1250 gain, max 25% rate)
- Remaining gain: $520,000. Excluded: $500,000. Taxable long-term capital gain: $20,000.
Now flip the order: rent for 2 years first, then live there 3 years. The 2 rental years are nonqualified use, so 2/5 of the $520,000, which is $208,000, would generally be taxable, and only the other $312,000 would be eligible for the exclusion. Same house, same years, very different tax bill. The calendar really is the strategy here.
Records that make this painless
- The closing statement from the purchase, which shows your starting basis.
- Receipts for improvements such as additions, a new roof or a remodel, which add to basis. Repairs and maintenance generally don't.
- Proof of residence dates: driver's license, voter registration, utility bills, and the address on your tax returns.
- Depreciation schedules from any rental or home office years.
- The sale closing statement and any Form 1099-S.
A shoebox works. So does a folder in the cloud named something boring. What doesn't work is trying to rebuild 14 years of receipts in the week before filing.
FIRE angle: a large taxable gain can push income into higher capital gains brackets, past ACA subsidy thresholds, and into NIIT territory in the year of the sale. As of tax year 2026, the 0% long-term rate applies to taxable income up to $98,900 for joint filers. Plan the sale year alongside your withdrawal plan and see variable percentage withdrawal for one way to absorb lumpy income.
FAQ
How long do I have to live in a house to avoid capital gains tax?
Generally at least 24 months as your main home during the 5 years before the sale, and you must also have owned it for at least 24 months in that window. Then up to $250,000 of gain ($500,000 for most joint filers) can be excluded.
Can I use the home sale exclusion more than once?
Yes, but generally not more than once in any 2-year period.
Do I pay tax on depreciation when I sell a former rental I lived in?
Yes. Depreciation allowed or allowable after May 6, 1997 can't be excluded, and it's generally taxed as unrecaptured Section 1250 gain at a maximum 25% rate.
What if I sell before 2 years because of a job move?
You may qualify for a partial exclusion if the main reason was a change in place of employment, health, or certain unforeseen circumstances, generally prorated by the portion of the 2-year period you met.
Do I have to report a home sale if all the gain is excluded?
If you received a Form 1099-S, report the sale on Form 8949 and Schedule D even if the gain is fully excluded. Otherwise, a fully excluded gain generally doesn't need to be reported.
Sources & fact-check notes
- IRS Topic 701, Sale of your home (accessed 2026-10-25)
- IRS Publication 523, Selling Your Home (accessed 2026-10-25)
- IRS Topic 409, Capital gains and losses (accessed 2026-10-25)
- IRS Topic 559, Net investment income tax (accessed 2026-10-25)
- IRS Rev. Proc. 2025-32 (2026 inflation adjustments) (accessed 2026-10-25)
Figures checked October 25, 2026. Rules and limits change; verify with the official source before acting.