Section 121 Home Sale Exclusion — Exclude Up to $500,000 of Capital Gains When You Sell Your Home
What Is It?
Under Internal Revenue Code § 121, you can exclude up to $250,000 of capital gains (single filers) or $500,000 (married filing jointly) from the sale of your primary residence — completely tax-free. No other investment in the tax code gets this treatment: stock gains, rental property gains, and business asset gains are all taxable. Home gains are not, if you qualify.
A couple who bought a home for $400,000 and sells it for $900,000 can exclude the entire $500,000 gain — saving roughly $100,000 in federal capital gains taxes at the 20% rate, plus any applicable Net Investment Income Tax (3.8%).
The Two Tests You Must Meet
1. Ownership test: You must have owned the home for at least 2 of the 5 years ending on the sale date. The 2 years do not have to be consecutive.
2. Use test: You must have used the home as your principal residence for at least 2 of the 5 years ending on the sale date. The ownership and use periods do not have to overlap (though they usually do).
Principal residence means the home where you live most of the time. You can only have one principal residence at a time.
Frequency limit: You can only use the exclusion once every 2 years.
How to Calculate Your Gain
Your taxable gain is: Sale price − Adjusted basis − Selling costs
Your adjusted basis is not just what you paid — it includes:
- Purchase price (including closing costs you paid: title insurance, legal fees, recording fees)
- Plus: Capital improvements made while you owned the home (additions, new roof, kitchen remodel, HVAC replacement — not routine maintenance)
- Minus: Any depreciation claimed if the home was ever used as a rental or home office
Keep records of every improvement. A $50,000 kitchen remodel done 10 years ago directly reduces your taxable gain by $50,000.
Partial Exclusion for Shorter Ownership
If you don’t meet the full 2-year requirement because of a qualifying unforeseen circumstance, you may still claim a partial exclusion proportional to how long you lived there. Qualifying reasons include:
- Change in place of employment
- Health condition requiring a move
- Unforeseen circumstances (divorce, death of co-owner, multiple births from the same pregnancy, natural disaster, job loss, inability to afford the home)
The partial exclusion equals: (months of qualifying use ÷ 24) × full exclusion amount.
What Most People Don’t Know
- Home office deductions reduce your basis. If you claimed a home office deduction and depreciated part of your home, that depreciation must be “recaptured” at a 25% rate even if the rest of the gain qualifies for the § 121 exclusion. Keep a record of any depreciation claimed on Schedule C or Form 8829.
- Rental use within the 5-year window matters. If you rented the home out for part of the last 5 years, the exclusion does not apply to gain allocated to any period of non-qualified use after 2008 (pre-2009 non-qualified use periods are ignored). Plan your move-back timing accordingly.
- You don’t have to report the sale if the gain is fully excluded. If your gain is fully under the exclusion limit and you received a Form 1099-S, you technically must report it on Schedule D — but if no 1099-S was issued and the gain is fully excludable, you generally don’t need to report the sale at all.
- Inherited homes get a stepped-up basis separately. If you inherit a home and sell it, different rules apply (see the Stepped-Up Basis on Inherited Assets loophole).
- Married couples filing separately each get only $250,000. Filing jointly is almost always better for this exclusion.
Who Benefits Most?
Homeowners in high-appreciation markets (coastal cities, metros with constrained housing supply) who have owned their home for several years. A couple in a major metro who bought in 2015 for $600,000 and sells in 2026 for $1,100,000 has a $500,000 gain that is entirely tax-free under § 121. The same gain on a stock portfolio would cost roughly $100,000+ in federal taxes.
Legal Basis
- 26 U.S.C. § 121 — Exclusion of gain from sale of principal residence
- Treasury Regulation § 1.121-1 through § 1.121-4 — Detailed requirements for ownership, use, and partial exclusion
- IRS Publication 523 — Selling Your Home (authoritative plain-English guide)
Frequently Asked Questions
Can I use the exclusion on a second home or vacation property?
No — § 121 only applies to your principal residence, the home where you live most of the time. However, if you move into a vacation home and live in it as your principal residence for at least 2 years before selling, the portion of gain attributable to qualified use (with adjustments for any prior rental/non-qualifying periods) may be excludable.
What if my gain exceeds the exclusion limit?
The amount above the exclusion is taxed as a long-term capital gain (0%, 15%, or 20% depending on your income) plus potentially the 3.8% Net Investment Income Tax if your modified AGI exceeds $200,000 (single) or $250,000 (married). Accurate record-keeping of improvements is the best way to minimize the taxable excess.
My spouse died last year and I’m selling now. Do I still get the $500,000 exclusion?
Possibly yes. A surviving spouse may claim the full $500,000 exclusion (not just $250,000) if the sale occurs within 2 years of the spouse’s death and you meet the other requirements. This is a significant and often overlooked rule — worth confirming with a tax professional given your specific situation.
Do I owe state capital gains tax even if federal gains are excluded?
Many states conform to § 121 and provide the same exclusion. However, some states have their own rules, lower exclusion amounts, or no conformity at all. Check your state’s treatment separately — California, for example, generally conforms but has no preferential long-term rate, so any gain above the federal exclusion limit is taxed as ordinary income at the state level.
Can I use the exclusion if I converted my home to a rental before selling?
Yes, but only for the portion of the gain attributable to qualifying use. If you lived in the home for 3 years and then rented it for 2 years, you meet the 2-of-5 year tests (since the 5-year window goes back from the sale date). However, the 2 years of rental use after 2008 count as non-qualified use, so a proportional share of the gain (2/5) is taxable. The depreciation claimed during the rental period is also subject to 25% recapture regardless.