When you sell your primary home, the capital gains tax on a home sale usually comes to nothing. Federal law lets a single filer exclude up to $250,000 of profit, and a married couple filing jointly can exclude up to $500,000, provided you’ve owned and lived in the home long enough. Anything above the exclusion is taxed as a long-term capital gain at 0%, 15%, or 20%, depending on your income, and higher earners can owe an extra 3.8% on top.
Who Qualifies for the Exclusion
The exclusion sits in Internal Revenue Code Section 121, and it turns on two tests. You must have owned the home for at least two years out of the five years ending on the sale date, and you must have lived in it as your primary residence for at least two of those same five years. The 24 months of residency don’t have to be consecutive, so a work assignment or long trip that pulled you away for a stretch won’t automatically disqualify you.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
There is also a look-back rule. You can’t have used the Section 121 exclusion on a different home sale in the two years before the current sale.2Internal Revenue Service. Publication 523 (2025), Selling Your Home
Partial Exclusion for Early Sales
If you sell before hitting the two-year mark, you can still qualify for a prorated exclusion when the reason is a job change, a health issue, or certain other unforeseen events. The IRS divides the time you actually lived in the home by 730 days (or 24 months) and multiplies the result by the full $250,000 or $500,000. Sell after 18 months as a single filer for a qualifying reason, and your reduced ceiling is about $187,500.2Internal Revenue Service. Publication 523 (2025), Selling Your Home
Qualifying reasons include a death in the family, job loss that makes you eligible for unemployment compensation, a natural disaster that damages the home, multiple births from one pregnancy, and a change in your ability to afford the home tied to a shift in employment or marital status. Marriage on its own doesn’t count, and neither does a general drop in home values.
How Much You Can Exclude
The dollar ceilings track your filing status:
- Single, head of household, or married filing separately: up to $250,000 of gain is excluded.
- Married filing jointly: up to $500,000, as long as at least one spouse meets the ownership test, both spouses meet the use test, and neither used the exclusion on another home in the prior two years.2Internal Revenue Service. Publication 523 (2025), Selling Your Home
If only one spouse qualifies, the couple still gets $250,000 rather than being shut out entirely. Gain above the applicable limit is taxed.
Surviving Spouses
A widow or widower who sells within two years of a spouse’s death can claim the full $500,000, provided they haven’t remarried by the sale date and the couple would have met the ownership, use, and look-back requirements right before the death. The surviving spouse’s time counts the deceased spouse’s ownership and use, so the two-year clock doesn’t restart.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Rates on Gain Above the Exclusion
If you owned the home more than a year, the taxable portion is a long-term capital gain. For 2026 the brackets are:
- 0% on taxable income up to $49,450 (single), $98,900 (married filing jointly), or $66,200 (head of household).
- 15% above the 0% threshold up to $545,500 (single), $613,700 (married filing jointly), or $579,600 (head of household).
- 20% above the 15% ceiling.3Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026
The 3.8% Net Investment Income Tax
Higher earners pay an additional 3.8% surtax on net investment income when modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). Those thresholds are fixed in the statute and aren’t indexed for inflation. The tax applies to the lesser of your net investment income or the amount by which your income exceeds the threshold.4Internal Revenue Service. Net Investment Income Tax
Gain you shelter under Section 121 does not count toward this calculation. Only the taxable portion of your home sale profit shows up as net investment income.5Internal Revenue Service. 2025 Instructions for Form 8960 – Net Investment Income Tax
Figuring the Taxable Gain
Start with three numbers: your cost basis, your capital improvements, and your selling expenses.
Your cost basis is what you paid for the home plus acquisition costs from the original closing, such as title insurance, legal fees, and transfer taxes. The settlement statement from your purchase is the document to hold on to.
Add the cost of capital improvements you made over the years. Upgrades that increase value or extend the life of the home count: a new roof, an added bathroom, a kitchen remodel, a replaced HVAC system. Routine maintenance such as repainting or fixing a leaky faucet does not. Purchase price plus improvements gives you your adjusted basis.
Subtract your adjusted basis and your selling expenses (agent commissions, legal fees, advertising) from the sale price. That’s your net gain. Apply the $250,000 or $500,000 exclusion. Whatever remains is taxable.
Inherited Homes
If you inherited the home, your basis is not what the previous owner paid. It is generally the fair market value on the date of that person’s death. If a parent bought a house for $80,000 in 1985 and it was worth $400,000 when they died, your basis is $400,000. That “step-up” often wipes out most or all of the taxable gain.6Internal Revenue Service. Gifts and Inheritances
Homes Received in Divorce
A transfer between spouses as part of a divorce is not itself taxable. The receiving spouse takes over the other spouse’s adjusted basis rather than a fresh basis at current market value, which can leave a large taxable gain when the home is eventually sold, especially after significant appreciation.7Office of the Law Revision Counsel. 26 USC 1041 – Transfers of Property Between Spouses or Incident to Divorce
When the Exclusion Doesn’t Apply
Some sales are ineligible even when the profit is well under the dollar caps.
Second Homes, Vacation Properties, and Rentals
The exclusion is only for your primary residence: the place you actually live most of the time. A lake house you visit on weekends, a ski condo, or a rental you’ve never lived in doesn’t qualify. The IRS looks at where you get your mail, where you’re registered to vote, and where you spend the majority of your nights.
Property Acquired Through a 1031 Exchange
If you used a like-kind exchange under Section 1031 to defer tax on an investment property and later moved in, the Section 121 exclusion is off-limits for five years from the date you acquired the property in the exchange. Sell before that anniversary and the whole gain is taxable no matter how long you lived there.8Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence
Non-Qualified Use and Depreciation Recapture
If the property was a rental or used for business before it became your home, part of your gain is ineligible for the exclusion. The IRS allocates the gain based on the ratio of non-qualified use to total ownership. Own a home for ten years, rent it out for four of those years after January 1, 2009, and roughly 40% of the gain sits outside the exclusion.8Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence
Separately, any depreciation you claimed during a rental or business period must be recaptured and is taxed at a maximum rate of 25%, even when the rest of your gain is fully excluded. That piece catches a lot of sellers by surprise.9Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed
Military and Foreign Service Sellers
Active-duty members of the uniformed services, the Foreign Service, and the intelligence community can suspend the five-year look-back for up to 10 years while stationed at least 50 miles from the home, or while living in required government housing, for more than 90 days or an indefinite period. That effectively stretches the window for meeting the two-year residency requirement to 15 years. The suspension covers the servicemember’s spouse as well.10Internal Revenue Service. Topic No. 701, Sale of Your Home1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Selling at a Loss
A loss on your primary residence is not deductible. The IRS treats a personal home as personal-use property, and personal-use losses can’t offset capital gains or reduce ordinary income. The loss simply doesn’t exist for federal tax purposes.11Internal Revenue Service. Capital Gains, Losses, and Sale of Home
Reporting the Sale
Whether you report the sale depends on two things: whether your gain exceeds the exclusion, and whether you received a Form 1099-S from the closing agent. Form 1099-S reports the gross sale price to you and to the IRS.12Internal Revenue Service. About Form 1099-S, Proceeds From Real Estate Transactions
If your gain is fully excluded and you didn’t get a 1099-S, you don’t need to report the sale at all. If you received a 1099-S, you report the sale on Form 8949 and Schedule D (Form 1040) even when the whole gain is excluded. The same forms handle a sale where the gain exceeds the exclusion; the taxable portion is calculated there.2Internal Revenue Service. Publication 523 (2025), Selling Your Home
Sellers who owe the 3.8% net investment income tax on the taxable portion also file Form 8960.5Internal Revenue Service. 2025 Instructions for Form 8960 – Net Investment Income Tax
State Capital Gains Taxes
Federal rules are only half the picture. Most states with an income tax also tax capital gains, with top rates running from 0% in no-income-tax states to roughly 13% or more at the high end. Many states follow the federal Section 121 exclusion, so the first $250,000 or $500,000 is exempt at the state level too, but not all do. Check your state’s tax authority before assuming the federal treatment carries over.