Most people who sell their home owe no federal capital gains tax on a primary residence. Section 121 of the tax code lets a single filer exclude up to $250,000 of profit from the sale, and a married couple filing jointly can exclude up to $500,000, provided the ownership and use requirements are met.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Any profit above those limits is taxed at long-term capital gains rates, which run 0, 15, or 20 percent depending on your income.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Who Qualifies for the Exclusion
You have to pass two tests during the five-year window ending on the sale date:1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
- Ownership: you held title to the property for at least 24 months out of the last five years.
- Use: you lived in it as your primary residence for at least 24 months out of the last five years.
Those months don’t have to be consecutive. Moving out and moving back in is fine, as long as the totals add up. If you own more than one home, the IRS looks at facts and circumstances, and the biggest factor is where you spent most of your time.3Internal Revenue Service. Publication 523, Selling Your Home
There is also a frequency limit. You can only claim the exclusion once every two years. If you already used it on a previous home sale, wait a full 24 months from that sale before claiming it again.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
How Much Profit Is Tax-Free
Filing status controls the ceiling:
- Single or married filing separately: up to $250,000 of gain excluded.
- Married filing jointly: up to $500,000 of gain excluded.
To get the full $500,000 as a couple, at least one spouse must meet the ownership test and both spouses must independently meet the use test. If only one of you actually lived there long enough, the joint exclusion drops back to $250,000.4Internal Revenue Service. Topic No. 701, Sale of Your Home These dollar limits are set by statute and are not adjusted for inflation.
A quick example. Single seller, $200,000 profit: nothing owed. Single seller, $300,000 profit: capital gains tax applies to $50,000, the amount over the limit.
Surviving Spouses
A widow or widower who has not remarried can still claim the full $500,000 exclusion, but only if the home is sold within two years of the spouse’s death. The couple must have met the ownership, use, and two-year lookback requirements immediately before the death, and the surviving spouse can count the deceased spouse’s time toward the tests.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Sell later than that and the ceiling reverts to $250,000.
Selling Before You Hit Two Years
If you have to sell before meeting the ownership or use requirement, a partial exclusion is available when the main reason for selling is a job move, a health issue, or an unforeseen event.3Internal Revenue Service. Publication 523, Selling Your Home
A work-related move qualifies if the new workplace is at least 50 miles farther from the home than the old workplace was. A health-related sale qualifies if you move to get treatment for yourself or a family member, to provide care for someone who’s sick, or if a doctor recommends a change of residence.3Internal Revenue Service. Publication 523, Selling Your Home
The regulations also list specific unforeseen-event safe harbors: involuntary conversion of the home (condemnation), damage from a natural disaster or act of war, divorce or legal separation, job loss that qualifies for unemployment benefits, and an employment change that leaves you unable to cover housing and basic living expenses.5eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements
The prorated exclusion is figured by dividing the time you actually met the shortest applicable requirement by 24 months, then multiplying by $250,000 or $500,000. Single filer who lived in the home 12 of the required 24 months: 12/24 × $250,000 = $125,000 of gain excluded.6Internal Revenue Service. Publication 523, Selling Your Home – Section: Does Your Home Qualify for a Partial Exclusion of Gain?
Figuring Your Actual Gain
Your gain isn’t just sale price minus what you paid. Start with your cost basis: the purchase price plus settlement costs at closing like title insurance, transfer taxes, recording fees, legal fees, and survey costs.7Internal Revenue Service. Publication 551, Basis of Assets Fees tied to the mortgage itself, such as loan origination or mortgage insurance, don’t count.
Add the cost of capital improvements. These are projects that add value, extend the home’s life, or adapt it to a new use: an addition, a full roof replacement, a paved driveway, central air, or rewiring.7Internal Revenue Service. Publication 551, Basis of Assets Routine repairs like painting or fixing a leaky faucet don’t. If you claimed the federal energy efficient home improvement credit for an upgrade made before 2026, reduce the basis increase by the credit you received. Spent $10,000 on qualifying insulation and got a $3,000 credit? Only $7,000 gets added.8Office of the Law Revision Counsel. 26 U.S.C. 25C – Energy Efficient Home Improvement Credit
When you sell, subtract your adjusted basis and your selling expenses (agent commissions, seller-paid title insurance, legal fees, advertising) from the sale price. That’s your realized gain, and it’s the number you compare against the $250,000 or $500,000 exclusion.
What Rate Applies to Anything Above the Exclusion
Assuming you owned the home more than a year, any excess gain is a long-term capital gain, taxed at 0, 15, or 20 percent depending on your taxable income and filing status.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses Most sellers with moderate income land in the 15 percent bracket. The 20 percent rate applies to high earners. For 2025, that’s single filers above $533,400 in taxable income or joint filers above $600,050. The IRS adjusts these thresholds annually for inflation.
Net Investment Income Tax
Higher-income sellers may owe an additional 3.8 percent Net Investment Income Tax on gain that exceeds the exclusion. It applies when modified adjusted gross income tops $200,000 for single filers, $250,000 for joint filers, or $125,000 for married filing separately.9Internal Revenue Service. Net Investment Income Tax Gain covered by the Section 121 exclusion is not counted as net investment income, so the surtax only reaches the portion above $250,000 or $500,000. These NIIT thresholds are also set by statute and don’t move with inflation.
State Taxes
Most states with an income tax also tax capital gains, generally at ordinary income rates. Most follow the federal exclusion, so you’d only owe state tax on gain above the federal limit. Several states have no individual income tax at all. State rates on taxable gains can range from zero to over 13 percent depending on where you live.
Two Things That Can Shrink the Exclusion
Depreciation Recapture
If you ever claimed depreciation on the home, say because you rented it out or took a home office deduction, the exclusion does not shelter the piece of the gain attributable to that depreciation. Any depreciation taken (or that could have been taken) for periods after May 6, 1997, must be recognized as taxable gain even if the rest of your profit sits within the exclusion.10Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain From Sale of Principal Residence Recaptured depreciation is taxed at up to 25 percent.11Internal Revenue Service. Property (Basis, Sale of Home, Etc.) 5 And skipping a depreciation deduction you were entitled to doesn’t help. The IRS still requires you to reduce basis by the allowable amount.
Non-Qualified Use Periods
If the property wasn’t always your primary home, part of your gain may not qualify. The IRS allocates gain to non-qualified use based on a ratio: total time (after January 1, 2009) the property was not your primary residence, divided by total time you owned it.10Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain From Sale of Principal Residence Own a home for 10 years, rent it out the first 4, live in it the last 6? Forty percent of the gain is allocated to non-qualified use and cannot be excluded. The regular $250,000 or $500,000 exclusion still applies to the remaining 60 percent.
Military and Foreign Service Members
If you or your spouse are on qualified extended duty in the uniformed services or the U.S. Foreign Service, you can elect to suspend the five-year ownership-and-use window for up to 10 years. The lookback period can stretch as long as 15 years, giving you room to meet the two-year use test even if deployment kept you away.12eCFR. 26 CFR 1.121-5 – Suspension of 5-Year Period for Certain Members of the Uniformed Services and Foreign Service You make the election by filing your return for the year of sale without including the gain. Only one property at a time can have its clock suspended.
Reporting the Sale
You have to report the sale if your gain exceeds the exclusion limit or if the closing agent issues you a Form 1099-S.13Internal Revenue Service. Instructions for Form 1099-S Report it on Form 8949, which carries the purchase and sale dates and the proceeds, then flow the numbers to Schedule D of Form 1040.3Internal Revenue Service. Publication 523, Selling Your Home
If your full gain fits inside the exclusion and no 1099-S was issued, you generally don’t need to report the sale at all. The closing agent can skip issuing a 1099-S if you give them a written certification that the home is your principal residence and the full gain is excludable.13Internal Revenue Service. Instructions for Form 1099-S
Keep Your Records
Hold the purchase agreement, closing disclosure, and receipts for every capital improvement for at least three years after you file the return for the year of the sale. If you underreport income by more than 25 percent, the IRS has six years to audit, so six years is safer.14Internal Revenue Service. How Long Should I Keep Records Those improvement receipts are what let you push your basis up and your taxable gain down.