How the Section 121 exclusion works
Your gain on a home sale is the amount realized, meaning the sale price minus selling costs such as agent commissions, less your adjusted cost basis: what you paid, plus certain closing costs and the improvements still part of the home. Section 121 removes up to $250,000 of that gain from your gross income, or $500,000 on a joint return. Gain above the limit is taxed as a long-term capital gain if you owned the home for more than a year.
Excluded gain isn’t income at all. It doesn’t raise your adjusted gross income and isn’t subject to the 3.8% net investment income tax. There is no lifetime cap: you can use it again on each later home that passes the tests.
The limits were set in 1997 and have never been indexed for inflation. For 2026 they are still $250,000 and $500,000, so a home bought decades ago in an expensive market can outgrow them.
The ownership, use and look-back tests
To claim the full exclusion you must pass three tests, all measured back from the date of sale. Ownership: you owned the home for at least 24 months of the last five years. Use: you lived in it as your main home for at least 24 months, or 730 days, of those same five years. Look-back: you didn’t exclude gain on another home sale in the two years before this one.
The 24 months don’t have to be continuous, and the ownership and use periods don’t have to overlap, as long as both fall within the five-year window. Vacations and other short absences count as time lived there. If you become unable to care for yourself after living in the home at least 12 months, time in a licensed care facility counts toward the use test. Members of the uniformed services, the Foreign Service, the intelligence community and the Peace Corps on qualified extended duty can suspend the five-year window for up to 10 years.
Couples who are married filing jointly get $500,000 when either spouse meets the ownership test and both meet the use and look-back tests. A widow or widower who hasn’t remarried keeps the $500,000 limit for a sale within two years of the spouse’s death, easing the widow’s penalty on a home sale.
Partial exclusions when you sell early
Selling before you meet the two-year tests doesn’t always forfeit the break. If the main reason is a change in workplace, health, or an unforeseeable event, you can claim a reduced exclusion. A work move qualifies when the new job is at least 50 miles farther from the home than the old one. Health moves include moving to get or provide treatment or care for your own or a family member’s illness or injury, or on a doctor’s advice. Unforeseeable events include the home being destroyed or condemned, a death, a divorce or legal separation, multiple births, or a change in employment that leaves you unable to pay basic living expenses.
The reduced limit is $250,000 times the shortest of three periods divided by 24 months: your time living in the home during the five years, your time owning it, and the time since you last used the exclusion. On a joint return, each spouse’s share is figured the same way and added. A single owner who lived in the home 12 months before a qualifying job transfer can exclude up to $125,000. Because the limit is prorated rather than the gain, that often still shelters all of a modest gain.
Rentals, home offices and depreciation
Renting out or working from a home changes the math in three ways. First, depreciation you claimed, or could have claimed, after May 6, 1997, can’t be excluded. That slice of the gain is taxed as unrecaptured Section 1250 gain at up to 25%, which is how rental property depreciation follows you into a home sale.
Second, gain allocated to nonqualified use is taxable. Nonqualified use means periods after 2008 when neither you nor your spouse lived in the home as a main residence, such as years it was a rental or second home before you moved in. The taxable share is those days divided by your total days of ownership. Time after you move out doesn’t count, so renting out a former home for up to three years before selling can keep the full exclusion, apart from the depreciation.
Third, a separate part of the property used for business or rent, like the second unit of a duplex you live in through house hacking, isn’t covered unless you also lived in that part for two of the five years. A home office or rented room inside your living space needs no split. And a home you received in a 1031 exchange must be held five years before any gain on it can be excluded.
How the exclusion fits a lifetime plan
Downsizing in retirement can free home equity largely tax-free, but gain above the limit lands in one year on top of your other income. It can push you into a higher capital gains bracket, trigger the net investment income tax, and raise Medicare IRMAA premiums two years later, while the excluded part does none of these things. Selling in a lower-income year, such as after paychecks stop, can shrink those side effects.
Holding the home until death is the main alternative. Heirs receive a step-up in basis to market value, which can erase gain the exclusion would never have covered. That trade-off leads some owners with gains far above the limit to stay put and borrow against the home instead of selling.
Keep closing statements and improvement receipts for as long as you own the home, and for three years after the due date of the return for the year you sell. Every documented improvement lowers the gain that might exceed the limit.
Illustrative numbers
A married couple sells the home they bought in 2008
- $250,000
- The full limit for one person; on a joint return, figure each spouse separately and add
- Shortest qualifying period
- The least of months lived there and months owned in the last five years, and months since your last exclusion
- 24
- The two-year test in months (or use days ÷ 730)
It applies only when a job move, health reasons or an unforeseeable event is the main reason you sell before meeting the two-year tests.
Sale price$1,050,000
Selling costs, including commission−$55,000
Amount realized$995,000
Adjusted basis: $350,000 price + $60,000 of improvements$410,000
Gain$585,000
Joint exclusion−$500,000
Taxable long-term gain$85,000
At a 15% long-term rate the federal tax is $12,750, and the excluded $500,000 never enters their income. Without receipts for the $60,000 of improvements, the taxable gain would be $145,000 and the tax $21,750.
At a glance
Maximum Section 121 exclusion by situation
| Situation | Maximum exclusion | Key condition |
|---|---|---|
| Single or married filing separately | $250,000 | Owned and lived in the home 2 of the last 5 years |
| Married filing jointly | $500,000 | Either spouse owned it; both lived there 2 of 5 years |
| Joint return, only one spouse qualifies | Usually $250,000 | Each spouse’s own limit is added |
| Surviving spouse, not remarried | $500,000 | Sale within 2 years of the death |
| Early sale for work, health or an unforeseeable event | Prorated share | Qualifying months ÷ 24 |
| Home acquired in a 1031 exchange | $0 | If sold within 5 years of the exchange |
Put it in your plan
Home sale exclusion in MoneyWhatIf
Mark a property card as your primary home and give it a planned sale year and selling-cost percentage. MoneyWhatIf compares the sale price with the home’s modeled basis, applies the federal $250,000 single or $500,000 joint exclusion, and prices any remaining gain through the long-term capital gains brackets, NIIT and state tax. The cash the sale releases is the price less the remaining mortgage, selling costs and modeled tax, and the taxable net worth view applies the same exclusion. It does not capture every improvement, depreciation-recapture or eligibility detail, so check those yourself.
Common questions
Home sale exclusion FAQs
Do I have to buy another home to avoid capital gains tax?
No. Before May 7, 1997, sellers could postpone the gain by rolling it into a replacement home, and people 55 or older had a one-time exclusion. A 1997 law ended both and created today’s exclusion, which applies whether you buy a bigger home, downsize or rent. Any gain above the limit is taxed in the year of sale, whatever you do with the proceeds.
Do I have to report a home sale if all the gain is excluded?
Usually not. If your whole gain is excludable and you don’t receive Form 1099-S, the sale doesn’t go on your return. If you do receive a 1099-S, or part of the gain is taxable, you report the sale on Form 8949 and Schedule D and subtract the excluded amount.
Can I use the home sale exclusion on a second home or vacation home?
Only on your main home, and you can have just one at a time; where you spend the most time is the key factor. You can move into a second home and make it your main residence for two years, but gain allocated to years after 2008 when it wasn’t your main home stays taxable, and so does depreciation from any rental use.
How does divorce affect the home sale exclusion?
Transferring the home to a spouse or ex-spouse in a divorce is generally tax-free. If you receive it, you count the time your ex-spouse owned it, but you must meet the use test yourself. If you move out while your ex-spouse lives there under a divorce or separation instrument, you are treated as still using it as your home, so your share of a later sale can still qualify for up to $250,000.
Can I deduct a loss when I sell my home for less than I paid?
No. A loss on the sale of a personal residence isn’t deductible, so it can’t offset other gains or create a capital loss carryover. You still report the sale if you receive Form 1099-S. A loss can count only on property, or a separate part of it, that you used for business or rent, and that part is figured separately.