When you sell your primary home, federal law lets you exclude up to $250,000 of profit from capital gains tax if you file as single, or up to $500,000 if you’re married filing jointly. That exclusion covers most sales outright, meaning most homeowners owe no capital gains tax on a home sale at all.1Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence You owe tax only if your gain exceeds those limits, you fail the eligibility tests, you sell within a year of buying, or the home was previously a rental.
Who Qualifies for the Exclusion
Two tests decide whether you get the full exclusion, and both look at the five-year period ending on the sale date. The ownership test requires that you held title for at least two of those five years. The use test requires that you lived in the home as your primary residence for at least two of those five years.2Internal Revenue Service. Topic No. 701, Sale of Your Home The two years of residency don’t have to be back-to-back. You also can’t have used this exclusion on another home sale in the prior two years.1Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence
For married couples claiming the full $500,000, only one spouse needs to satisfy the ownership test, but both spouses must independently meet the use test, and neither can have used the exclusion within the past two years.2Internal Revenue Service. Topic No. 701, Sale of Your Home Married couples filing separately can each exclude up to $250,000 on their own returns if each individually qualifies.3Internal Revenue Service. Publication 523, Selling Your Home
Partial Exclusion If You Sell Early
Selling before the two-year mark doesn’t automatically wipe out the benefit. If the move is driven by a job relocation, a health condition, or certain unforeseen circumstances, you can claim a reduced exclusion proportional to the time you did live there. Twelve months of the required 24 gets you half the maximum amount.1Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence Military members on extended duty get an even broader break: they can suspend the five-year test period for up to 10 years while serving.2Internal Revenue Service. Topic No. 701, Sale of Your Home
If the IRS ever questions your primary-residence claim, utility bills, voter registration, and the address on your federal returns all help prove it.
Calculating the Gain
Gain isn’t just sale price minus purchase price. The tax code uses “adjusted basis,” which starts at what you paid and moves up or down based on what happened while you owned the home. Subtract that adjusted basis from the “amount realized” (sale price minus commissions, legal fees, and other selling costs) and you have your gain.
Building Your Basis
Your starting basis is the purchase price plus certain closing costs: title insurance, recording fees, transfer taxes, and legal fees for the title search.3Internal Revenue Service. Publication 523, Selling Your Home Costs tied to getting the mortgage itself, like loan origination fees or the lender’s appraisal, don’t count.4Internal Revenue Service. Publication 551, Basis of Assets
Capital improvements that add value or extend the home’s life increase your basis. A new roof, an added bathroom, a finished basement. Routine maintenance like repainting or fixing a faucet doesn’t count. The line is whether the work improved the property beyond its prior condition or just kept it in the same condition.
What Lowers Your Basis
Several things reduce your adjusted basis and therefore increase taxable gain: insurance reimbursements for casualty losses, depreciation you claimed (or were entitled to claim) for a home office or rental use, and certain energy credits.5Internal Revenue Service. Publication 523, Selling Your Home – Section: Basis Adjustments Depreciation is easy to miss because the reduction applies whether or not you actually took the deduction.
Keep every renovation receipt and closing statement. If the IRS questions your basis, the burden of proof is on you, and the agency can request documentation for at least three years after you file.6Internal Revenue Service. Topic No. 305, Recordkeeping
Rates on Any Taxable Gain
Once you know how much gain exceeds your exclusion (or that you don’t qualify for one), the rate depends on how long you owned the home. More than a year is long-term. One year or less is short-term.
Long-term capital gains rates for 2026:
- 0% on taxable income up to $49,450 (single), $98,900 (married filing jointly), or $66,200 (head of household)
- 15% above those thresholds up to $545,500 (single), $613,700 (joint), or $579,600 (head of household)
- 20% on taxable income above the 15% thresholds
Short-term gains are taxed at ordinary income rates, which can run as high as 37%.7Internal Revenue Service. Topic No. 409, Capital Gains and Losses Selling a primary home inside a year is uncommon, but the tax hit is significant, which is another reason the two-year mark matters.
Most states with an income tax also tax capital gains, so your federal number may not be the whole bill.
The 3.8% Surtax on Higher Incomes
On top of the standard rate, high earners can owe an additional 3.8% net investment income tax when modified adjusted gross income exceeds:8Office of the Law Revision Counsel. 26 U.S. Code 1411 – Imposition of Tax
- $200,000 for single filers or heads of household
- $250,000 for married filing jointly
- $125,000 for married filing separately
The 3.8% applies to the lesser of your net investment income or the amount by which your income exceeds the threshold. Home-sale gain counts as investment income only to the extent it isn’t sheltered by the Section 121 exclusion. A married couple with a $600,000 gain who excludes $500,000 still has $100,000 of investment income that can trigger the surtax if their total income is high enough. These thresholds haven’t been adjusted for inflation since the tax took effect in 2013.
If the Home Was Ever a Rental or Business Property
Prior rental or business use creates two separate problems, and both can bite even when you otherwise satisfy the ownership and use tests.
Nonqualified Use
Any time after 2008 during which the home was not your primary residence is “nonqualified use.” A portion of your gain proportional to that period cannot be excluded. Divide nonqualified time by total ownership time, and that fraction of the gain is taxable.9Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Own a home for 10 years, rent it for 4, live in it for 6, and roughly 40% of your gain falls outside the exclusion. Temporary absences of up to two years for job changes or health conditions don’t count as nonqualified use, and neither does military extended duty.
Depreciation Recapture
Depreciation you claimed (or were entitled to claim) during any business or rental period is taxed at a maximum federal rate of 25%, regardless of the exclusion.7Internal Revenue Service. Topic No. 409, Capital Gains and Losses The recapture is calculated first, then the Section 121 exclusion applies to what’s left. Rent out a home for five years and claim $50,000 in depreciation, and that $50,000 is taxable at up to 25% when you sell, even if the rest of your gain is fully excluded.
Selling a Home You Inherited
Inherited homes get much friendlier treatment. Instead of taking on the deceased owner’s original basis, you get a “stepped-up” basis equal to the property’s fair market value on the date of death.10Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent All the appreciation during the previous owner’s lifetime escapes capital gains tax.
If a parent bought a home for $80,000 in 1985 and it was worth $450,000 at their death, your basis starts at $450,000. Sell for $460,000, and your taxable gain is $10,000. Inherited property is automatically treated as long-term for capital gains purposes, even if you sell it within days.11Office of the Law Revision Counsel. 26 USC 1223 – Holding Period of Property You can still use the Section 121 exclusion on an inherited home, but only if you move in and meet the two-year tests. Most heirs who sell soon after inheriting rely on the stepped-up basis alone.
Do You Have to Report the Sale?
If your gain is fully covered by the exclusion and the closing agent didn’t send you a Form 1099-S, you don’t need to report the sale on your return at all.3Internal Revenue Service. Publication 523, Selling Your Home Most homeowners who lived in their home for two or more years and had a gain under the limit fall into this category.
You do need to report the sale if:
- Your gain exceeds the exclusion. The taxable portion goes on Form 8949 and Schedule D of Form 1040.
- You received a Form 1099-S. Even if the entire gain is excludable, the IRS got a copy of that form and expects to see the sale on your return.12Internal Revenue Service. Instructions for Form 1099-S
- You choose not to claim the exclusion, perhaps to preserve it for a larger expected gain on a future sale.
Form 8949 captures the acquisition date, sale date, proceeds, and adjusted basis. Net results flow to Schedule D, where the tax is calculated.13Internal Revenue Service. Instructions for Form 8949 If part of the gain qualifies for the exclusion, you enter the excluded amount as a negative adjustment on Form 8949 so only the taxable portion carries forward.14Internal Revenue Service. Form 8949 Codes Keep your closing disclosures, improvement receipts, and proof of residency for at least three years after filing; the IRS can audit within that window, and the burden of proving your basis is on you.15Internal Revenue Service. How Long Should I Keep Records