Section 121 of the Internal Revenue Code is the rule that lets a homeowner exclude up to $250,000 of capital gain ($500,000 for a married couple filing jointly) when selling a principal residence, provided the ownership and use requirements are met. The exclusion applies automatically, with no special election to file, and it can be used repeatedly across a lifetime as long as at least two years pass between qualifying sales. For most homeowners, it is the largest single tax break they will ever claim.
The Ownership and Use Tests
To claim the full exclusion, you have to pass two tests during the five-year window that ends on the date of sale. The ownership test requires that you held title to the property for at least two of those five years. The use test requires that you lived in it as your principal residence for at least two of those five years. The 24 months of ownership and the 24 months of use don’t need to be consecutive, and the two periods don’t need to overlap. Rent a home for three years, buy it, live there two more, and you qualify.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Short temporary absences still count as use. A vacation or a few months of work travel doesn’t break your use period, as long as the home stayed your base.2eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence
There is also a frequency limit. If you excluded gain from a different home sale within the two years before the current sale, you are locked out of Section 121 entirely for this transaction.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
If you own more than one home, the IRS looks at the totality of your circumstances to decide which one counts as your principal residence: where you work, where your family lives, the address on your tax returns and driver’s license, where your bank accounts sit, and where you spend the most time.2eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence
How Much Gain You Can Exclude
The ceiling depends on your filing status. A single filer can exclude up to $250,000 of gain. A married couple filing jointly can exclude up to $500,000, but only if at least one spouse meets the ownership test, both spouses meet the use test, and neither spouse used the exclusion on another home sale in the prior two years. If one spouse qualifies on both tests but the other doesn’t meet the use test, the couple falls back to $250,000.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
These dollar limits are fixed in the statute. They have not been adjusted for inflation since 1997.
Your gain is the sale price, minus selling costs, minus your adjusted basis. Adjusted basis starts with what you paid for the home and grows with capital improvements such as a new roof, a kitchen renovation, or an addition. Routine maintenance and repairs don’t count. Any gain above the exclusion is taxed at long-term capital gains rates.
Reduced Exclusion When You Sell Early
If you sell before satisfying the full two-year ownership or use requirement, you may still qualify for a partial exclusion, but only if the sale was triggered by a change in employment, a health condition, or unforeseen circumstances as defined by the regulations.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Each category has a safe harbor. The employment safe harbor is met when a new workplace is at least 50 miles farther from the home you sold than your old workplace was.3U.S. Department of the Treasury. Treasury Regulation 1.121-3 – Reduced Maximum Exclusion for Taxpayers Health qualifies when a doctor recommends the move, or when you are moving to obtain or provide care for a family member. Unforeseen circumstances include involuntary conversion, natural or man-made disasters, death, divorce, job loss qualifying for unemployment benefits, an inability to pay basic housing costs after a change in employment, and multiple births from the same pregnancy.4eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers
The reduced exclusion is proportional. You multiply the full amount by a fraction: months of ownership or use (whichever is shorter) over 24. A single taxpayer forced to relocate after 15 months can exclude up to $156,250 ($250,000 × 15/24). A married couple in the same situation can exclude up to $312,500.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
What Section 121 Does Not Shelter
Meeting the tests doesn’t guarantee the whole gain escapes tax. Three carve-outs matter most.
Nonqualified Use
Any period after December 31, 2008, when the property was not your (or your spouse’s or former spouse’s) principal residence counts as nonqualified use, and the corresponding portion of gain cannot be excluded. You prorate: months of nonqualified use divided by total months of ownership.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Timing matters. Only nonqualified use before you moved in counts against you. If you lived in the home, then moved out and rented it before selling, that post-residence rental period is not treated as nonqualified use. The rule closes the strategy of buying a rental, holding it for years, moving in for two, and walking away tax-free on the entire gain.
Depreciation Recapture
Depreciation you claimed (or could have claimed) on the property after May 6, 1997, has to be recaptured. This unrecaptured Section 1250 gain is taxed at a maximum rate of 25% and can never be excluded under Section 121.5Internal Revenue Service. Property (Basis, Sale of Home, Etc.) 5 Home-office deductions and prior rental use both trigger it. If you deducted $30,000 in depreciation over the years, that $30,000 comes back as taxable income when you sell, even if your total gain is well below $250,000.
Net Investment Income Tax on the Excess
Gain that fits within the Section 121 exclusion is shielded from the 3.8% Net Investment Income Tax. Gain above the exclusion is not, and it can trigger NIIT if modified adjusted gross income exceeds $250,000 for joint filers, $200,000 for single filers, or $125,000 for married filing separately.6Internal Revenue Service. Questions and Answers on the Net Investment Income Tax Combined with the 20% long-term capital gains rate, the federal rate on the excess can reach 23.8%, before any state tax or depreciation recapture.
Situations With Their Own Rules
Surviving Spouse
A widow or widower who sells within two years of a spouse’s death can still claim the full $500,000 exclusion as a single filer, provided the joint-exclusion requirements were satisfied as of the date of death.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Sell one day after the second anniversary of the death and the limit drops to $250,000. The surviving spouse also receives a stepped-up basis on the decedent’s share of the home, reset to fair market value on the date of death.7Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent Together, the two provisions often eliminate the tax entirely.
Military, Foreign Service, and Intelligence Personnel
Members of the uniformed services, the Foreign Service, and the intelligence community can elect to suspend the five-year lookback for up to 10 additional years while on qualified official extended duty, stretching the window to as long as 15 years. Qualified extended duty means serving at a duty station at least 50 miles from the home, or living in government quarters under orders, for more than 90 days or an indefinite period. The suspension covers the servicemember’s spouse as well, applies to only one property at a time, and must be elected; it doesn’t happen automatically.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Divorce
When a home is transferred between spouses or former spouses as part of a divorce, the recipient inherits the transferor’s ownership period, so the ownership clock doesn’t reset. Each ex-spouse can independently claim a $250,000 exclusion, as long as each meets the two-year use test individually. The spouse who stayed in the house is usually fine; the one who moved out can lose the use qualification if too much time passes before the sale.
Property Acquired Through a 1031 Exchange
If you obtained the home in a like-kind exchange under Section 1031, an additional rule kicks in: you must own the property for at least five years, measured from the exchange date, before Section 121 becomes available. The nonqualified use rules also carve out the pre-conversion investment period, so even after five years of ownership and two years of residence, part of the gain remains taxable.
Reporting the Sale
If your gain is fully covered by the exclusion and you didn’t receive a Form 1099-S at closing, you generally don’t need to report the sale at all. You do have to report it if:
- Your gain exceeds the exclusion amount.
- You received a Form 1099-S, even when the whole gain is excludable.
- You choose to treat the gain as taxable, to preserve the exclusion for a larger sale within the next two years.8Internal Revenue Service. Publication 523 (2025), Selling Your Home
Reportable sales go on Form 8949, with totals carried to Schedule D of Form 1040.9Internal Revenue Service. About Form 8949, Sales and Other Dispositions of Capital Assets The third option above is worth thinking about: if you claim the exclusion now and sell another home within two years, you can file an amended return within three years to undo the earlier election, but only if you actually reported the first sale.