Capital Gains Tax When Selling Your Home: The $250K/$500K Exclusion Explained

· Guide · 6 min read

Most homeowners who sell their primary residence owe no federal capital gains tax. The IRS allows an exclusion of up to $250,000 in profit for single filers and $500,000 for married couples filing jointly — and for most sellers who bought more than a few years ago, that exclusion covers their entire gain. Understanding how the exclusion works, what counts toward your basis, and when you might owe tax helps sellers plan their transaction correctly and avoid surprises at tax time.

The Section 121 Exclusion: The Basics

The home sale exclusion — formally called the Section 121 exclusion — allows qualifying homeowners to exclude up to $250,000 (single) or $500,000 (married filing jointly) of capital gain from their federal taxable income. This exclusion applies to your primary residence, not investment properties, vacation homes, or rental properties.

Ownership and Use Tests

To claim the full exclusion, you must pass both tests:

The 24 months don't need to be consecutive. You can aggregate periods of use scattered across the 5-year window. If you owned and lived in the home for 18 months, moved out and rented it for 2 years, then moved back in for 6 months before selling, you'd total 24 months of use and qualify.

The 5-year lookback window is the key timing consideration. If you owned and lived in the home 6+ years ago and then rented it, that earlier period of use no longer counts — only the last 5 years matter. Sellers who converted primary residences to rentals need to track carefully whether they still pass the use test.

Frequency Limitation

You can only use the exclusion once every 2 years. If you sold another home and claimed the exclusion within the 24 months before your current sale, you don't qualify again yet. This rarely affects primary residence sellers but matters for people who buy, live in, improve, and sell homes in rapid succession.

Calculating Your Capital Gain

Capital gain on a home sale isn't simply "sale price minus what I paid." The actual calculation involves your adjusted basis, and getting it right can significantly reduce your taxable gain — or confirm you owe nothing.

Starting Basis: Your Purchase Price

Your basis begins with the price you paid for the home, plus the acquisition costs you paid at closing that weren't deductible as current expenses: title insurance, recording fees, and your share of transfer taxes. Real estate agent commissions paid when you bought the home are also added to basis.

Additions to Basis: Capital Improvements

Capital improvements — permanent additions that increase the home's value, extend its useful life, or adapt it to new uses — increase your basis and reduce your taxable gain. Common qualifying improvements:

Routine maintenance and repairs (painting, fixing a leak, replacing a single appliance) don't add to basis — they're expenses, not improvements. The distinction matters: a $40,000 kitchen remodel increases your basis by $40,000 and reduces your eventual taxable gain by the same amount.

Keep all receipts for capital improvements. If your gain approaches the exclusion threshold, documentation becomes essential. Records from 20–30 years of ownership can be difficult to reconstruct; building a home improvement file from the day you purchase is the right approach.

Reductions to Basis: Depreciation

If you ever rented part or all of your home or used part of it exclusively for business (a legitimate home office deduction), you claimed depreciation on that portion. Every dollar of depreciation claimed reduces your basis by a corresponding amount — and that depreciation is taxable upon sale as "unrecaptured Section 1250 gain" at a maximum federal rate of 25%, even if the overall gain would otherwise be excluded.

Example: You claimed $15,000 in home office depreciation over 10 years. Even if your total gain is under the exclusion threshold, $15,000 of that gain is taxable as depreciation recapture.

Selling Costs That Reduce Your Gain

Selling costs paid by the seller reduce the amount realized on the sale — effectively increasing your basis for calculation purposes:

On a $600,000 sale with 5% agent commissions ($30,000) and $8,000 in other selling costs, your amount realized is $562,000 — not $600,000. This difference flows directly through to your gain calculation.

When You Might Owe Capital Gains Tax

Gain Exceeds the Exclusion

If you've owned the home for many years in a high-appreciation market, your gain may exceed $250,000 (single) or $500,000 (married). The portion of gain above the exclusion is subject to long-term capital gains tax. Federal long-term capital gains rates are 0%, 15%, or 20% depending on your total income — most sellers land in the 15% bracket. Some states also tax capital gains at the ordinary income rate.

Example: A single seller with $380,000 in gain claims the $250,000 exclusion. The remaining $130,000 is taxable at the federal long-term rate — $19,500 in federal tax at 15%.

Failed Ownership or Use Tests

If you sell before satisfying the 2-year requirements, the full gain is taxable. Sellers who must move for employment, health, or unforeseen circumstances may qualify for a partial exclusion — calculated as a fraction of the full exclusion proportional to the time held relative to 24 months.

Net Investment Income Tax

Higher-income sellers may also owe the 3.8% Net Investment Income Tax (NIIT) on the taxable portion of their gain. For 2026, the NIIT applies to single filers with modified adjusted gross income over $200,000 and married filers over $250,000. The tax applies to the lesser of net investment income or the amount of MAGI over the threshold.

State Tax Considerations

Most states follow the federal exclusion for primary residence gains, but several important exceptions apply:

In high-tax states on large gains, state tax can be a meaningful number. A California seller with $200,000 in taxable gain (after the exclusion) owes significant California state tax regardless of the federal exclusion treatment.

What Your Real Estate Agent Can and Cannot Help With

Your listing agent can provide a seller's net sheet — an estimate of your expected proceeds after commissions, closing costs, and mortgage payoff. What they can't do is calculate your capital gains tax liability. That calculation requires knowledge of your acquisition cost, improvements, depreciation history, and current tax situation — information only you and your accountant have.

The most valuable thing your agent does on the tax front: accurately account for all selling costs that reduce your amount realized, and remind you to gather improvement records before you sell rather than scrambling afterward.

For a complete picture of what sellers pay at closing, our guide on how to read a seller's net sheet breaks down every line item from sale price to proceeds in your pocket. And if you're planning timing around both buying and selling, our guide on how to buy and sell simultaneously covers the sequencing decisions that affect both transactions.

Browse real estate agents by city or find agents near you — an experienced listing agent provides the accurate commission and closing cost estimates that feed directly into your capital gains calculation, and knows which local practices (transfer tax conventions, seller concession norms) affect your net proceeds.

Frequently Asked Questions

Do I have to pay capital gains tax when I sell my house?
Most homeowners who sell their primary residence owe no federal capital gains tax. The IRS allows an exclusion of up to $250,000 in gains for single filers and $500,000 for married couples filing jointly, provided you've owned and lived in the home for at least 2 of the last 5 years. If your gain is under those thresholds, you owe nothing.
How is capital gain calculated when selling a home?
Your capital gain is your sale price minus your adjusted cost basis. Your adjusted basis starts with your purchase price and increases with capital improvements (additions, remodels, new roof, new HVAC) and decreases with depreciation taken on the property if it was ever used as a rental or home office. Selling costs like agent commissions and closing fees also reduce your gain.
What is the 2-out-of-5-year rule for the home sale exclusion?
To claim the full exclusion, you must have owned the home for at least 2 years and used it as your primary residence for at least 2 years during the 5-year period ending on the sale date. The 2 years don't need to be continuous — you can add up months scattered across the 5-year window. Part-year use may qualify for a partial exclusion in some circumstances.
Do I have to report the home sale on my tax return if I owe no tax?
If your gain is fully excluded and you meet the ownership and use tests, you generally don't need to report the sale on your federal return. However, you must report it if you have a loss (which isn't deductible for a primary residence), received a Form 1099-S from closing, or the exclusion doesn't fully cover your gain. Always consult a tax professional for your specific situation.
Can I use the home sale exclusion more than once?
Yes — there's no lifetime limit on how many times you can use the exclusion. You can claim it on each home you sell, provided you meet the ownership and use tests each time. The only restriction is the frequency rule: you generally cannot claim the exclusion on more than one sale within a 2-year period.