Capital Gains Exclusion on a Home Sale (Section 121)
If you sell your main home, you may be able to exclude up to $250,000 of gain from federal income tax, or up to $500,000 if you are married filing jointly, when you meet the Section 121 ownership and use tests. The exclusion reduces taxable gain, not the sale price.
The capital gains exclusion on a home sale, often called the Section 121 exclusion, is the federal tax rule that lets a qualifying seller keep up to $250,000 of profit free of federal capital gains tax, or up to $500,000 for a married couple filing jointly. It applies to gain, not to the full sale price, and only to a home you owned and used as your primary residence.
What the exclusion does
When you sell property for more than your cost basis, the difference is a capital gain. Most capital gains are taxable. Section 121 creates an exception for a principal residence. A qualifying seller can exclude part or all of that gain from federal income tax. The excluded portion is not reported as income, and only the gain above the exclusion is potentially subject to tax.
The exclusion can be used more than once in a lifetime. It is not reserved for first-time buyers, and it is not a temporary program. Each time you sell a primary residence and meet the tests, you may claim it again. Because of this, the exclusion is one of the largest tax benefits available to ordinary households, and it rewards homeowners who keep good records of what they paid and what they improved.
The rule: ownership and use for 2 of 5 years
To qualify, you must have owned the home and lived in it as your primary residence for at least two of the five years ending on the date of sale. Ownership and use are separate requirements, though they usually overlap. The two years do not need to be consecutive. Short absences, such as vacations or a brief gap between moves, generally do not interrupt the use test as long as the home remained your principal residence.
You also generally cannot claim the exclusion if you excluded gain from another home sale within the two years before this one. That rule keeps the benefit tied to a genuine move rather than a rapid series of flips. If you are married and file jointly, both spouses must meet the ownership and use tests for the full $500,000 amount, though special rules can apply when a spouse has died.
| Requirement | Single filer | Married filing jointly |
|---|---|---|
| Maximum gain excluded | $250,000 | $500,000 |
| Ownership test | 2 of the last 5 years | 2 of the last 5 years |
| Use as primary residence | 2 of the last 5 years | 2 of the last 5 years |
| Typical frequency | Once every 2 years | Once every 2 years |
How to calculate your gain
Your gain is the amount realized minus your adjusted basis. The amount realized is the sale price minus the costs of selling, such as agent compensation and certain closing costs. Your adjusted basis starts with what you paid for the home, plus the cost of capital improvements, minus any depreciation you claimed, for example if you rented the home or used part of it for business.
Capital improvements increase basis. A new roof, an added bathroom, or a major kitchen remodel can raise your basis and reduce taxable gain. Routine repairs that simply maintain the home generally do not. Keeping records of improvements is one of the simplest ways to lower a future tax bill. The IRS explains basis and the exclusion in Publication 523 and Topic No. 701, both listed on the sources page.
What improvements do
Improvements are additions or upgrades that increase the home value, prolong its life, or adapt it to new uses. Examples include room additions, new systems, and major landscaping. Because they add to basis, they directly reduce the gain that the exclusion must cover. Repairs, by contrast, keep the home in ordinary working condition and are not added to basis. The distinction matters because it changes the number you subtract from the sale price, and the difference can be thousands of dollars over a long ownership period.
Partial exclusion and exceptions
If you cannot meet the two-of-five test because of a change in employment, a health condition, or certain unforeseen events, you may qualify for a reduced, partial exclusion. The partial amount is generally the full exclusion multiplied by the fraction of the two-year period you did meet. Other special rules apply to situations such as divorce, a deceased spouse, and certain military, Foreign Service, or intelligence community service.
A seller who does not qualify for any exclusion still may owe little or no tax if the gain is small, because long-term capital gains are taxed at preferential rates and the standard deduction and other rules apply. The important point is that the exclusion is not all-or-nothing in every case, and the partial rules are worth checking before you assume a tax bill.
When the 3.8% NIIT can apply
Gain above the exclusion is included in net investment income for purposes of the net investment income tax. The NIIT is 3.8% on the lesser of net investment income or modified adjusted gross income above $200,000 for a single filer or $250,000 for a married couple filing jointly. Those thresholds are not indexed for inflation. A large gain that exceeds the exclusion can therefore trigger both capital gains tax and the surtax, which is why high-value sellers should model the numbers before closing.
Long-term capital gains rates for 2026 follow the brackets in IRS Rev. Proc. 2025-32. The 0% rate applies up to $49,450 for single filers, $98,900 for married filing jointly, $66,200 for heads of household, and $49,450 for married filing separately. The 15% rate applies above those amounts up to $545,500 single, $613,700 married filing jointly, $579,600 head of household, and $306,850 married filing separately. The 20% rate applies above those levels. Run your own numbers with the capital gains tax calculator to see how the exclusion and the brackets interact.
Common mistakes
- Treating repairs as improvements. Only capital improvements raise basis.
- Ignoring selling costs. Agent compensation and certain closing costs reduce the amount realized.
- Assuming the exclusion is automatic. You generally must meet the ownership and use tests and report the sale correctly.
- Forgetting the two-year frequency rule when selling more than one home in a short window.
- Overlooking the NIIT on a large gain that exceeds the exclusion.
For a deeper walkthrough of timing and strategies, see how to avoid capital gains tax on a home sale.
Frequently asked questions
How much gain can I exclude when I sell my home?
Up to $250,000 if you are single and up to $500,000 if you are married filing jointly, provided you owned and used the home as your primary residence for at least two of the five years before the sale.
Do the two years of ownership and use have to be consecutive?
No. The two years can be spread across the five-year period before the sale. Short absences generally do not break the use test as long as the home remained your principal residence.
Do home improvements reduce my taxable gain?
Yes. Capital improvements add to your adjusted basis, which lowers the gain. Routine repairs that maintain the home generally do not add to basis.
What happens if I do not meet the two-of-five test?
You may qualify for a reduced, partial exclusion if the move was due to a change in employment, a health condition, or certain unforeseen events. Otherwise the gain above your basis may be taxable at long-term capital gains rates.
Can the 3.8% net investment income tax apply to a home sale?
Yes, in some cases. The 3.8% NIIT applies to the lesser of net investment income or modified adjusted gross income above $200,000 single or $250,000 married filing jointly, and those thresholds are not indexed for inflation.
Get matched with a local agent
Compare licensed agents in your area before you list. Free and no obligation.
Get Matched With an Agent →Free and no obligation. You choose whether to work with any agent.
Cite this page
ListWithAgent Editorial Team. “Capital Gains Exclusion on a Home Sale (Section 121).” https://listwithagent.com/reference/capital-gains-exclusion/. Accessed 2026-09-12.
Sources
- IRS Publication 523 — Selling Your Home — Internal Revenue Service — irs.gov
- IRS Revenue Procedure 2025-32 — 2026 inflation adjustments (capital gains thresholds) — Internal Revenue Service — irs.gov
- IRS Topic No. 409 — Capital Gains and Losses — Internal Revenue Service — irs.gov
- IRS Topic No. 701 — Sale of Your Home — Internal Revenue Service — irs.gov
- IRS — Net Investment Income Tax — Internal Revenue Service — irs.gov
Every figure and rule on this page traces to the official publishers above. See our methodology.
Not a brokerage and not advice. List With Agent is not a real estate brokerage. We are an independent marketing and referral service that connects home sellers with licensed real estate agents. This page is general educational information, not legal, financial, or real estate advice.
By the ListWithAgent Editorial Team. Last updated 2026-09-12. Educational information only — not legal, financial, or real estate advice.