Primary Residence Exclusion: Capital Gains, Recapture, and Reporting

When you sell your primary home, federal law lets you exclude a large slice of the profit from tax: up to $250,000 if you file singly, or up to $500,000 if you’re married filing jointly. Anything above that threshold is taxed as a long-term capital gain, usually at 15%. This is the capital gains tax on a primary residence sale in its simplest form, and most homeowners who have lived in the property for at least two of the past five years qualify for the full exclusion automatically. The complications live in the edge cases: home offices, prior rental use, early sales, and inherited property.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

Who Qualifies for the Exclusion

Two tests decide eligibility. You must have owned the home for at least two years during the five-year window ending on the sale date, and you must have lived in it as your principal residence for at least two years during that same window. The two years don’t have to be continuous, and the ownership and use periods don’t have to line up with each other, as long as both are satisfied inside the five-year lookback.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

You can only use the exclusion once every two years. If you excluded gain on a different home sale within the prior 24 months, this sale doesn’t qualify.

For married couples aiming at the full $500,000, at least one spouse must meet the ownership test, both spouses must meet the use test individually, and neither can have claimed the exclusion on another home in the prior two years. If only one spouse passes both tests, the couple is capped at $250,000.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

If you own more than one home, only the one that qualifies as your principal residence gets the exclusion. The IRS applies a facts-and-circumstances test in which the biggest factor is where you spend the majority of your time, backed by the address on your tax returns, voter registration, and driver’s license.2Internal Revenue Service. Publication 523, Selling Your Home Condominiums, co-ops, houseboats, and mobile homes all count as long as they have sleeping, cooking, and bathroom facilities and you actually live there.

Figuring Your Gain

Gain is the sale price minus your adjusted basis. Adjusted basis starts with what you originally paid, then increases for capital improvements: projects that add value, extend the home’s useful life, or adapt it to a new use. A new roof, a kitchen remodel, or an added bathroom qualifies. Routine maintenance and repairs don’t.

Certain closing costs from both the purchase and the sale also affect the number. Settlement fees, title insurance, real estate commissions, and transfer taxes factor in. Keep the receipts. The IRS can audit a home sale years after filing, and without documentation you can lose basis adjustments that would have kept your gain under the exclusion cap.

If you inherited the home, your basis is generally the fair market value on the date the previous owner died, not what they paid decades earlier. That stepped-up basis often eliminates most or all of the taxable gain.3Internal Revenue Service. Gifts and Inheritances

What You Owe on Gain Above the Exclusion

Profit that exceeds the exclusion is taxed as long-term capital gain, assuming you owned the home for more than a year. For 2026, the federal rate is 0%, 15%, or 20% depending on your total taxable income. Most sellers land at 15%. The 20% rate kicks in above $545,500 for single filers or $613,700 for married couples filing jointly.4Internal Revenue Service. Topic No. 409, Capital Gains and Losses

Higher-income sellers face a second layer. The 3.8% Net Investment Income Tax applies when modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). It only hits the gain above the Section 121 exclusion, but on a large sale it pushes the effective rate past 20%.5Internal Revenue Service. Topic No. 559, Net Investment Income Tax

Depreciation Recapture From a Home Office or Rental

Even if you meet every eligibility rule, the exclusion cannot shelter gain attributable to depreciation you claimed (or should have claimed) after May 6, 1997. If you took a home office deduction, or rented out part of the property, that depreciation gets recaptured at sale and taxed at a maximum rate of 25%.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence4Internal Revenue Service. Topic No. 409, Capital Gains and Losses

This is where long-running home offices produce unpleasant surprises. Years of modest deductions add up. When the business-use space is inside the home itself, like a spare bedroom used as an office, you pay tax on the depreciation amount and exclude the rest of the gain without splitting the sale price. When the business use sits in a separate structure on the property, such as a detached studio, you have to allocate basis and proceeds between the residential and non-residential portions, and the exclusion does not apply to the gain on the separate structure.6eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence

Non-Qualified Use if the Home Was Once a Rental

If the property served as something other than your principal residence during part of your ownership, a portion of the gain is not excludable. The non-excludable share equals the ratio of non-qualified use time to total ownership time.7Legal Information Institute. 26 USC 121(b)(5) – Exclusion of Gain Allocated to Nonqualified Use

Say you bought a property in 2016, rented it out for four years, moved in during 2020, and sold in 2026. You owned it for ten years, four of them non-qualified. Roughly 40% of your gain is ineligible for exclusion, and the remaining 60% can be excluded up to the applicable dollar limit.

Several periods don’t count against you. Any portion of the five-year lookback that falls after you stopped living in the home is not treated as non-qualified use, which protects sellers who move out before selling. Up to ten years of qualified extended military duty is exempt. And up to two total years of temporary absences for employment changes, health, or unforeseen circumstances are exempt.

Partial Exclusion When You Have to Sell Early

If you sell before hitting the two-year mark, you may still qualify for a reduced exclusion when the sale is driven by a job move, a health issue, or certain unforeseen events. The partial exclusion equals the fraction of the 24-month requirement you actually completed, applied to the full $250,000 or $500,000 cap. Fifteen months of residence gives you 15/24 of the maximum.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

A job change qualifies under a safe harbor if your new workplace is at least 50 miles farther from the home than the old one was. Starting a new job, transferring with the same employer, or becoming self-employed all count.8eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements

A health-driven sale qualifies when the move is needed to obtain medical care, provide care for a family member, or recover from an illness or injury. The health condition has to be a primary reason for the sale, and it can involve you, your spouse, a co-owner, or certain close family members in the household.

The IRS treats several specific events as automatic safe harbors for unforeseen circumstances: condemnation or destruction of the home; casualty from a natural disaster, terrorism, or act of war; death of an owner, spouse, or household member; a qualifying individual becoming eligible for unemployment benefits; a change in employment that makes housing costs and basic expenses unaffordable; divorce or legal separation; and multiple births from the same pregnancy. Events not on the list can still qualify if you can show the sale was primarily driven by something you couldn’t reasonably have anticipated when you bought.8eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements

Military, Surviving Spouses, Divorce, and 1031 Property

Service members and Foreign Service officers can elect to suspend the five-year lookback for up to ten years while on qualified official extended duty (active duty under orders for more than 90 days or an indefinite period, at a station at least 50 miles from the home or in government quarters). The suspension pauses the clock, so a service member deployed for years can still meet the two-out-of-five-year use test on return. You elect it by excluding the gain on the return for the year of sale, and it cannot run on two properties at once.9Legal Information Institute. Definition of Qualified Official Extended Duty From 26 USC 121(d)(9)10eCFR. 26 CFR 1.121-5 – Suspension of 5-Year Period for Certain Members of the Uniformed Services and Foreign Service

A surviving spouse can claim the full $500,000 exclusion, but the sale must close within two years of the spouse’s death, the surviving spouse must not have remarried by the sale date, neither spouse can have used the exclusion on a different sale in the prior two years, and the surviving spouse must meet the two-year ownership and use tests (counting the deceased spouse’s time). Miss the two-year window and the exclusion drops to $250,000.2Internal Revenue Service. Publication 523, Selling Your Home Separately, a surviving spouse usually gets a stepped-up basis to fair market value on the date of death, and in community property states both halves of the home step up, which can wipe out the taxable gain entirely.

In a divorce, the receiving spouse’s ownership period includes the time the transferring spouse owned the property, so a spouse who just received the home isn’t penalized for a short title history. And if your former spouse continues to live in the home under a divorce or separation decree, you’re treated as using it as your principal residence during that time, letting the departing spouse still meet the use test when the home is eventually sold.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

If you acquired the home through a 1031 like-kind exchange, for instance by swapping a rental into a property you later moved into, you cannot claim the Section 121 exclusion until five years after the exchange date. After that, the normal ownership and use tests still apply, and any gain allocated to non-qualified rental use reduces the excludable amount.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

What Happens if You Sell at a Loss

The exclusion covers gains only. If you sell your primary residence for less than your adjusted basis, the loss isn’t deductible. The IRS treats a personal residence as personal-use property, and losses on personal-use property can’t offset other income or capital gains.11Internal Revenue Service. Capital Gains, Losses, and Sale of Home You don’t report the sale at all unless you received a Form 1099-S.

Reporting the Sale on Your Return

You have to report a home sale on your federal return in any of these situations: your gain exceeds the exclusion (or you don’t qualify to exclude all of it); you received a Form 1099-S from the closing agent, even if the gain is fully excludable; or you’re choosing to report the gain as taxable, which is sometimes useful when you expect a larger gain on a future home sale and want to save the exclusion for that one. If none apply, you don’t need to include the sale on your return.2Internal Revenue Service. Publication 523, Selling Your Home

When reporting is required, use Form 8949 to list the purchase date, sale date, proceeds, and adjusted basis. The results flow to Schedule D of Form 1040. Note the Section 121 exclusion properly on these forms; otherwise the IRS may treat the entire sale price as taxable and send a notice.12Internal Revenue Service. Form 8949 – Sales and Other Dispositions of Capital Assets The 1099-S is filed by the settlement agent, and the IRS receives a copy, so if you got one you need to account for the transaction even when the whole gain is excluded.13Internal Revenue Service. Instructions for Form 1099-S

The filing deadline is April 15 for calendar-year taxpayers. Form 4868 buys an automatic six-month extension to file but does not extend the deadline to pay. If you owe tax on gain above the exclusion, interest and penalties start accruing after April 15 regardless of any extension.14Internal Revenue Service. When to File