Last updated: July 20, 2026
Quick Answer: Most U.S. homeowners who sell their primary residence can exclude up to $250,000 in profit from capital gains tax, or up to $500,000 if married filing jointly, as long as they meet the IRS ownership and use tests. If your gain falls below those thresholds and you qualify, you legally owe $0 in federal capital gains tax on the sale.
Key Takeaways
- The IRS Section 121 exclusion lets single filers exclude up to $250,000 in home sale profit; married couples filing jointly can exclude up to $500,000 (IRS Publication 523).
- To qualify, you must have owned and lived in the home as your primary residence for at least 2 of the last 5 years before the sale date.
- You can use the Section 121 exclusion more than once, but generally no more than once every 2 years.
- Deductible selling costs (agent commissions, closing costs, home improvements) reduce your taxable gain before the exclusion even applies.
- Inherited property receives a "stepped-up" basis under IRS rules, which can dramatically reduce or eliminate capital gains tax at the time of sale.
- Partial exclusions are available if you fail to meet the full 2-of-5-year rule due to job relocation, health reasons, or unforeseen circumstances.
- State capital gains tax rules vary, some states have no income tax, while others tax home sale gains at rates up to 13.3% (California Franchise Tax Board).

What Is the Primary Residence Exclusion for Capital Gains Tax?
The primary residence exclusion, officially called the Section 121 exclusion under the Internal Revenue Code, lets qualifying homeowners exclude a set amount of profit from a home sale from their federal taxable income. Single filers can exclude up to $250,000 in gain; married couples filing jointly can exclude up to $500,000.
This is the core reason why understanding the capital gains tax on home sale: how to legally owe $0 is so important for everyday sellers. If your profit falls under those limits and you meet the IRS requirements, you report the sale but owe nothing in federal capital gains tax.
Here's what makes this rule extraordinary: it's not a loophole or a gray area. It's a permanent provision of the tax code that has been in place since the Taxpayer Relief Act of 1997. The IRS literally wrote the playbook for this one.
How the exclusion works in plain terms:
- You calculate your gain: Sale price minus your adjusted basis (what you paid, plus improvements, minus depreciation if applicable).
- If the gain is under $250,000 (single) or $500,000 (married filing jointly), and you meet the ownership and use tests, your federal capital gains tax bill is $0.
- If the gain exceeds those limits, only the amount above the exclusion is taxable.
Example:
| Filing Status | Home Sale Profit | Exclusion Limit | Taxable Gain |
|---|---|---|---|
| Single | $180,000 | $250,000 | $0 |
| Single | $320,000 | $250,000 | $70,000 |
| Married Filing Jointly | $480,000 | $500,000 | $0 |
| Married Filing Jointly | $620,000 | $500,000 | $120,000 |
How Much Can You Exclude From Capital Gains Tax When Selling a House?
The exclusion amounts are fixed by the IRS and have not been adjusted for inflation since 1997. Single filers get a $250,000 exclusion; married couples filing jointly get $500,000. These numbers apply to your net profit, not the sale price.
One thing that trips people up: the exclusion applies to the gain, not the gross proceeds. So if you bought a home for $300,000 and sold it for $520,000, your gross gain is $220,000. As a single filer, that's under the $250,000 limit, you owe $0 in federal capital gains tax, even though the sale price was well above the exclusion threshold.
This is where it pays to let it cook before you see results. Homeowners who bought years ago and watched their equity build quietly are often shocked to find out they owe nothing when they sell.
Do I Have to Pay Capital Gains Tax If I Sell My Home?
Not necessarily, and for many sellers, the answer is a clean no. Whether you owe capital gains tax on a home sale depends on three things: how much profit you made, whether you qualify for the Section 121 exclusion, and your filing status.
You likely owe $0 if:
- Your profit is under $250,000 (single) or $500,000 (married filing jointly).
- You owned the home for at least 2 years.
- You lived in it as your primary residence for at least 2 of the last 5 years.
- You haven't used the exclusion on another home sale in the past 2 years.
You may owe capital gains tax if:
- Your profit exceeds the exclusion limit.
- The home was a rental property, second home, or investment property.
- You've already used the exclusion within the last 2 years.
- You owned the home for less than a year (short-term gains are taxed as ordinary income).
For sellers who are still deciding whether to sell now or hold, our Sell, Stay, or Rent It Out: 2026 Decision Guide for Homeowners breaks down the equity math in detail.

What Is the 2 Out of 5 Year Rule for Home Sale Capital Gains?
The 2-out-of-5-year rule is the IRS ownership and use test that determines whether your home qualifies as a primary residence for the Section 121 exclusion. To qualify, you must have owned the home and used it as your primary residence for at least 24 months out of the 60 months (5 years) immediately before the sale date.
The two tests, ownership and use, are separate. You need to meet both, but they don't have to overlap. For example, you could have owned the home for 3 years but only lived in it for the first 2 years before renting it out. As long as those 24 months of use fall within the 5-year window, you still qualify.
Key details on the 2-of-5 rule:
- The 24 months of use do not have to be consecutive.
- Short absences (vacations, temporary relocations) generally count as periods of use.
- The 5-year lookback period ends on the date of sale.
- Periods of extended active military duty may be excluded from the 5-year window, effectively extending it (IRS Publication 523).
Common mistake: Sellers who converted their primary residence into a rental property sometimes forget to count the clock. If you moved out more than 3 years before selling, you've fallen outside the 5-year window and no longer qualify, even if you lived there for a decade before renting.
How Do I Qualify for the $250,000 Capital Gains Exclusion?
Qualifying for the $250,000 exclusion (or $500,000 for married couples) comes down to four criteria, all sourced from IRS Publication 523:
- Ownership test: You owned the home for at least 2 years during the 5-year period ending on the sale date.
- Use test: You used the home as your primary residence for at least 2 years during the same 5-year period.
- Frequency test: You haven't excluded gain from another home sale in the 2-year period ending on the sale date.
- Filing status: For the full $500,000 exclusion, both spouses must meet the use test, and neither can have used the exclusion in the past 2 years.
So based on those four criteria, the qualification process is actually straightforward for most long-term homeowners. The IRS isn't gatekeeping this benefit, they wrote it into the code specifically to protect middle-class homeowners from being taxed on the equity they built in their primary home.
If you're preparing to sell and want to make sure your home is positioned to maximize your net proceeds, check out our guide on Preparing Your Home for Sale in 2026.
What Happens If I Don't Meet the Primary Residence Requirement?
If you don't fully meet the 2-of-5-year rule, you're not automatically disqualified from all tax relief. The IRS allows a partial exclusion if you failed to meet the requirements due to a qualifying reason.
Qualifying reasons for a partial exclusion (IRS Publication 523):
- A change in place of employment (you or your spouse got a new job requiring relocation).
- Health reasons (a doctor-recommended move for medical care).
- Unforeseen circumstances (death, divorce, natural disaster, job loss, multiple births from the same pregnancy).
How the partial exclusion is calculated:
The partial exclusion is prorated based on how much of the 2-year requirement you met. For example, if you lived in the home for 12 months (half of the required 24), you'd be eligible for half the exclusion, $125,000 for a single filer or $250,000 for a married couple.
What disqualifies you entirely:
- The home was never your primary residence (it was always a rental or vacation property).
- You used the exclusion on another home sale within the past 2 years and have no qualifying exception.
- The gain was from depreciation recapture on a rental portion of the home (that portion is taxed separately as ordinary income, not excluded).

What Expenses Can I Deduct From My Home Sale to Reduce Capital Gains?
Before the exclusion even kicks in, you can reduce your taxable gain by increasing your adjusted basis, the IRS-recognized cost of your home. A higher basis means a smaller gain, which means less (or zero) tax owed.
Costs that increase your basis (reduce your gain):
- Original purchase price
- Closing costs paid at purchase (title insurance, legal fees, recording fees)
- Capital improvements made during ownership (new roof, addition, kitchen remodel, HVAC replacement)
- Special assessments for local improvements (new sidewalks, sewer lines)
Selling costs that reduce your gain directly:
- Real estate agent commissions (typically 5-6% of the sale price)
- Closing costs paid by the seller
- Home staging costs
- Legal fees related to the sale
- Transfer taxes
What does NOT count:
- Routine repairs and maintenance (painting, fixing a leaky faucet)
- Costs already deducted on a prior tax return
- Mortgage payoff amounts
Fresh example: You bought a home for $250,000, spent $40,000 on a kitchen addition, paid $8,000 in closing costs at purchase, and sold it for $580,000 with $20,000 in agent commissions. Your adjusted basis is $298,000, your net proceeds are $560,000, and your gain is $262,000. As a single filer, only $12,000 is taxable after the $250,000 exclusion.
For sellers thinking about which improvements add the most value before listing, our Best Home Renovations for ROI: Gen Z Buyer Guide 2026 has the ranked breakdown.
Do I Owe Capital Gains Tax on Inherited Property?
Inherited property gets one of the most favorable tax treatments in the entire U.S. tax code: the stepped-up basis. When you inherit a home, your basis is reset to the fair market value of the property on the date of the original owner's death, not what they originally paid for it.
This means if your parent bought a home for $80,000 in 1985 and it was worth $420,000 when they passed, your basis is $420,000. If you sell it for $430,000, your taxable gain is only $10,000, not $350,000.
Key rules for inherited property:
- The stepped-up basis applies to property inherited from an estate, not property gifted before death.
- You do not need to meet the 2-of-5-year primary residence test to benefit from the stepped-up basis.
- If you move into the inherited home and later sell it, you may also qualify for the Section 121 exclusion on top of the stepped-up basis.
- The Section 121 exclusion and stepped-up basis are separate benefits, both can work in your favor.
Common mistake: Confusing inherited property with gifted property. If someone gifts you a home before they die, you inherit their original (low) basis, not the stepped-up value. The timing of the transfer matters enormously.
Can I Use the Capital Gains Exclusion More Than Once?
Yes, the Section 121 exclusion can be used repeatedly throughout your life, with one key restriction: you can only use it once every 2 years. There is no lifetime cap on the number of times you can claim it.
This is one of the most improperly gatekept facts in real estate tax education. Many homeowners assume the exclusion is a one-time benefit. It isn't. As long as each home you sell qualifies as your primary residence under the 2-of-5-year rule, and at least 2 years have passed since your last exclusion claim, you can use it again.
Practical scenario: A couple buys a home, lives in it for 3 years, sells it and excludes $380,000 in gain. They buy another home, live in it for 4 years, sell it and exclude $490,000 in gain. Both sales are completely tax-free at the federal level, and they've used the exclusion twice.
For buyers thinking about their next move, our U.S. Home Buyers Market Trends in 2026 covers what the current market looks like for move-up buyers.
How Do I Report a Home Sale With Zero Capital Gains Tax?
Even when you owe $0, you may still need to report the sale to the IRS. Whether you must file depends on whether you receive a Form 1099-S from the closing agent.
When you must report the sale (IRS Publication 523):
- You received a Form 1099-S from the title company or closing agent.
- Your gain exceeds the exclusion limit (report the taxable portion on Schedule D).
- You do not fully qualify for the exclusion.
When you may NOT need to report:
- Your gain is fully covered by the exclusion, AND you did not receive a Form 1099-S, AND you meet all the qualification criteria.
How to report when required:
- Complete IRS Form 8949 (Sales and Other Dispositions of Capital Assets).
- Transfer the totals to Schedule D of your Form 1040.
- If the gain is fully excluded, report the sale on Form 8949 with the exclusion amount noted, resulting in $0 taxable gain.
- Attach Schedule D to your Form 1040.
If you're unsure whether you received a 1099-S or need to report, a licensed CPA or tax professional can confirm your filing obligation. The IRS also provides free guidance in Publication 523 at irs.gov.
Can I Avoid Capital Gains Tax by Reinvesting Home Sale Proceeds?
This is one of the most persistent myths in residential real estate. For primary residences, reinvesting the proceeds into another home does NOT eliminate or defer capital gains tax. The old "rollover" rule that allowed this was repealed in 1997 when the Section 121 exclusion was created.
What does work for deferral, but only for investment properties:
- A 1031 exchange (like-kind exchange) lets real estate investors defer capital gains tax by reinvesting proceeds from an investment property sale into another qualifying investment property. This does not apply to primary residences.
- A Qualified Opportunity Zone (QOZ) investment can defer and potentially reduce capital gains tax if you reinvest gains into a designated opportunity zone fund within 180 days of the sale.
Bottom line for primary residence sellers: The Section 121 exclusion is your tool, not a 1031 exchange. You don't need to reinvest the proceeds anywhere specific. You can put the money in a savings account, buy a new home, or invest it in the stock market, the exclusion applies regardless of what you do with the proceeds after the sale.
For investors who do own rental or investment property and want to understand the 1031 exchange strategy, our Cash Flow Real Estate Investing: Find Deals That Pay Day One covers the investment side of the equation.

Does Capital Gains Tax Apply Differently in Different States?
Yes, state capital gains tax rules vary significantly, and some states can add a meaningful tax bill even when your federal liability is $0. Most states that have an income tax treat capital gains as ordinary income, taxed at the state's standard income tax rate.
State tax landscape at a glance:
| State | Capital Gains Tax Treatment | Max Rate (approx.) |
|---|---|---|
| California | Taxed as ordinary income | 13.3% (CA FTB) |
| New York | Taxed as ordinary income | Up to 10.9% (NY DTF) |
| Texas | No state income tax | 0% |
| Florida | No state income tax | 0% |
| Washington | Has a capital gains tax on gains over $262,000 (2026 threshold) | 7% |
| Oregon | Taxed as ordinary income | Up to 9.9% |
| Nevada | No state income tax | 0% |
Important note: Most states do not have their own version of the federal Section 121 exclusion at the same dollar thresholds. Some states conform to the federal exclusion; others have their own rules. California, for example, conforms to the federal exclusion, so if your gain is under $250,000 (single) or $500,000 (married), you owe $0 in California state capital gains tax on the home sale as well (California FTB Publication 1005).
Always confirm your specific state's rules with a tax professional or your state's department of revenue before closing.
For homeowners weighing where to buy next, our Best States for First-Time Home Buyers: 2026 Rankings factors in state tax environments alongside affordability and market conditions.
What If My Home Appreciated Less Than the Exclusion Amount?
If your profit is less than the exclusion limit, the capital gains tax on home sale situation is simple: you owe $0 in federal capital gains tax, and you likely don't even need to report the sale if you didn't receive a Form 1099-S.
This scenario is actually very common. According to the National Association of Realtors (NAR), the median existing-home sale price in the U.S. was approximately $407,000 as of early 2026. Many homeowners who bought at or below median prices years ago have built solid equity, but gains that still fall comfortably under the $250,000 or $500,000 thresholds.
What to do in this case:
- Calculate your adjusted basis (purchase price plus improvements plus buying closing costs).
- Subtract your adjusted basis from your net sale proceeds (sale price minus selling costs).
- If the result is under your exclusion limit, confirm you meet the 2-of-5-year rule.
- Keep all documentation (purchase records, improvement receipts, closing statements) for at least 3 years after filing.
The real work here is record-keeping. Sellers who can't document their improvements end up with a higher apparent gain than they actually had, and pay more tax than necessary.
Frequently Asked Questions
What is the capital gains tax rate on a home sale if I do owe taxes?
If your gain exceeds the exclusion limit, the taxable portion is subject to long-term capital gains tax rates if you owned the home for more than one year. For 2026, those rates are 0%, 15%, or 20% depending on your taxable income, per IRS tax brackets. Short-term gains (homes held under one year) are taxed as ordinary income.
Does the $500,000 exclusion require both spouses to have lived in the home?
Yes. For the full $500,000 married filing jointly exclusion, both spouses must meet the use test (2 of 5 years as primary residence), and neither spouse can have used the exclusion in the past 2 years. Only one spouse needs to meet the ownership test (IRS Publication 523).
Can I use the Section 121 exclusion on a home I also used as a rental?
Partially. If you rented out part of your home or converted it to a rental before selling, the exclusion only applies to the portion used as your primary residence. Any depreciation you claimed on the rental portion must be recaptured as ordinary income, it's not covered by the exclusion.
What if I'm in the military and stationed away from my home?
Active duty military members can suspend the 5-year lookback period for up to 10 years while on qualified extended duty. This means you can be away from your home for years due to military orders and still qualify for the exclusion when you eventually sell (IRS Publication 523, military exception).
Do I owe capital gains tax on a home sale if I sell at a loss?
No. Capital gains tax only applies to gains (profits). If you sell your primary residence for less than you paid (adjusted for improvements and costs), you have a capital loss, and unfortunately, capital losses on primary residence sales are not deductible on your federal return.
Is the capital gains exclusion automatic, or do I have to claim it?
You claim it by reporting the sale correctly on your tax return. If you received a Form 1099-S, you must file Form 8949 and Schedule D and apply the exclusion there. If you did not receive a 1099-S and your gain is fully excluded, the IRS does not require you to report the sale at all, but keeping documentation is still strongly advised.
What records should I keep to prove my adjusted basis?
Keep your original purchase closing disclosure, all receipts and contracts for capital improvements, any permits pulled for renovations, and your final sale closing disclosure. The IRS recommends keeping these records for at least 3 years after you file the return for the year of the sale.
How does the capital gains tax on home sale work for a home office deduction?
If you claimed a home office deduction in prior years and took depreciation on that portion of your home, that depreciation must be recaptured when you sell. The recaptured amount is taxed as ordinary income (up to 25%) and is not covered by the Section 121 exclusion. This is a frequently overlooked tax hit for self-employed homeowners.
The Bottom Line: Your $0 Tax Bill Is Earned, Not Accidental
The capital gains tax on home sale: how to legally owe $0 isn't a trick. It's a well-designed tax provision that rewards homeowners for building equity in a primary residence over time. The Section 121 exclusion is impeccable in its simplicity, own it, live in it, sell it, and in most cases, keep the profit tax-free.
The real work happens before the sale: tracking your improvements, confirming your residency timeline, understanding your state's rules, and keeping clean records. Sellers who do this consistently walk away with more money and zero surprises at tax time.
If you're getting ready to list, start with a clear picture of your adjusted basis and a conversation with a CPA who knows real estate. And if you want to make sure your home is positioned to sell at the best possible price before you even think about taxes, our Home Sellers Pricing Strategies: The 2026 Playbook That Actually Moves Properties is a fresh resource worth reading before you set your list price.
For more straight-talk real estate education from licensed brokers, visit Real Estate Rank IQ, ranked by brokers, read by everyone.
References
- IRS Publication 523: Selling Your Home, https://www.irs.gov/publications/p523 (2024)
- IRS Internal Revenue Code Section 121, https://www.law.cornell.edu/uscode/text/26/121
- California Franchise Tax Board Publication 1005: Selling Your Home, https://www.ftb.ca.gov/forms/2023/2023-1005.html (2023)
- National Association of Realtors, Existing-Home Sales Data, https://www.nar.realtor/research-and-statistics/housing-statistics/existing-home-sales (2026)
- IRS Form 8949 Instructions, https://www.irs.gov/forms-pubs/about-form-8949 (2024)
- Washington State Department of Revenue, Capital Gains Tax, https://dor.wa.gov/taxes-rates/other-taxes/capital-gains-tax (2024)
- Taxpayer Relief Act of 1997, Public Law 105-34, https://www.congress.gov/105/plaws/publ34/PLAW-105publ34.pdf (1997)
















