Section 121 Exclusion: How to Pay Zero Capital Gains Tax on Your Home

Understand the Section 121 exclusion that lets you exclude up to $500K in capital gains tax-free when selling your primary residence.

When you sell your primary residence at a profit, there is one tax provision that stands between you and a potentially enormous tax bill: the Section 121 exclusion. Named after Section 121 of the Internal Revenue Code, this rule allows homeowners to exclude up to $250,000 in capital gains from the sale of their home ($500,000 for married couples filing jointly) completely tax-free.

For many homeowners, this exclusion means they owe nothing in capital gains tax when they sell. But for those with significant appreciation, especially long-term homeowners in hot markets, the exclusion may not cover the full gain. And that is where understanding the rules, the limits, and the role of your home's cost basis becomes critical.

This guide explains how the Section 121 exclusion works, who qualifies, what happens when your gain exceeds the threshold, and how tracking your home improvements can save you thousands even when the exclusion applies.

What Is the Section 121 Exclusion?

The Section 121 exclusion is a federal tax benefit that allows you to exclude a portion (or all) of the profit from the sale of your primary residence from your taxable income. It is one of the most generous tax benefits available to individual taxpayers.

The basic rules are:

  • Single filers can exclude up to $250,000 in capital gains.
  • Married couples filing jointly can exclude up to $500,000 in capital gains.
  • The home must be your primary residence (not a rental property, vacation home, or investment property).
  • You must meet the ownership and use tests (explained below).
  • You cannot have used the exclusion on another home sale within the last two years.

The exclusion applies to federal capital gains tax. Depending on your state, your state may have its own rules for taxing home sale gains.

The Ownership and Use Tests

To qualify for the full Section 121 exclusion, you must pass two tests:

The Ownership Test

You must have owned the home for at least 2 of the last 5 years before the date of sale. The two years do not need to be consecutive. For example, if you owned the home from January 2021 to January 2023, sold it, bought it back in 2024, and owned it through 2026, you can add those periods together.

The Use Test

You must have used the home as your primary residence for at least 2 of the last 5 years before the date of sale. Again, the two years do not need to be consecutive. Temporary absences, such as vacations or short-term travel, generally count as periods of use.

Important Details About the Tests

  • The 2-year periods for ownership and use do not need to overlap. You could own the home for years 1-3 and live in it during years 3-5, and you would meet both tests.
  • Short temporary absences count as use. If you go on a 3-month vacation, that time still counts toward the use test.
  • The 5-year window is rolling. It is the 5-year period ending on the date of sale, not a fixed calendar period.
  • You can use the exclusion once every 2 years. If you sold a previous home and claimed the exclusion, you must wait at least 2 years before claiming it again.

Partial Exclusions for Special Circumstances

If you do not meet the full 2-year ownership and use requirements, you may still qualify for a partial exclusion if the sale was due to:

  • A change in employment — You or your spouse got a new job that requires relocating, or your employer transferred you to a new location.
  • Health reasons — A doctor recommended a move for medical reasons, or you moved to care for a family member with a health condition.
  • Unforeseen circumstances — Divorce, death of a spouse, loss of employment, natural disaster, or other events the IRS deems qualifying.

The partial exclusion is calculated proportionally. For example, if you lived in the home for 1 year out of the required 2, you can exclude 50% of the maximum amount ($125,000 for single filers, $250,000 for married couples).

Single vs. Married Filing Jointly

The difference between the $250,000 and $500,000 exclusion is one of the biggest financial planning considerations for homeowners.

Single Filers: $250,000 Exclusion

If you are single, you can exclude up to $250,000 in capital gains. For many single homeowners, especially those who have owned their home for a long time or live in high-appreciation markets, this may not be enough to cover the full gain. A single homeowner who bought a home for $300,000 fifteen years ago in a market that has seen strong appreciation could easily have a gain of $400,000 or more, meaning $150,000 or more would be taxable.

Married Filing Jointly: $500,000 Exclusion

Married couples filing jointly can exclude up to $500,000 in capital gains, provided:

  • Both spouses meet the use test (both lived in the home as a primary residence for 2 of the last 5 years).
  • At least one spouse meets the ownership test (at least one owned the home for 2 of the last 5 years).
  • Neither spouse has claimed the exclusion on another home sale within the last 2 years.

What If Only One Spouse Qualifies?

This comes up more often than people expect, particularly in cases of recent marriages, blended families, or situations where one spouse maintained a different primary residence.

  • If only one spouse meets both the ownership and use tests, the couple can still exclude up to $250,000(the qualifying spouse's individual exclusion) when filing jointly.
  • If one spouse owns the home but both have lived in it for 2+ years, they can claim the full $500,000 exclusion (since only one spouse needs to meet the ownership test).
  • If you are recently married and your new spouse just moved in, they may not meet the 2-year use test yet. In that case, you are limited to the $250,000 exclusion until they meet the requirement.

When the Exclusion Is Not Enough

The Section 121 exclusion is generous, but it has limits. For homeowners with large gains, the excess above the exclusion is taxed as a long-term capital gain (assuming you owned the home for more than one year, which you almost certainly did if you met the 2-year use test).

Capital Gains Tax Rates on the Excess

The gain above your exclusion amount is taxed at federal long-term capital gains rates, which for most taxpayers are:

  • 0% — For single filers with taxable income up to approximately $48,350 (2026 estimate) or married filing jointly up to approximately $96,700.
  • 15% — For most middle- and upper-middle-income taxpayers. This is where the majority of homeowners with taxable gains will fall.
  • 20% — For high-income taxpayers (single filers with taxable income over approximately $533,400, married filing jointly over approximately $600,050).

Additionally, high earners may be subject to the 3.8% Net Investment Income Tax (NIIT), which applies to individuals with modified adjusted gross income over $200,000 (single) or $250,000 (married filing jointly). The NIIT applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold.

This means a high-earning homeowner could face a combined federal rate of 23.8% (20% capital gains + 3.8% NIIT) on the gain above their exclusion. On a $300,000 taxable gain, that is $71,400 in federal tax.

This Is Where Tracked Improvements Pay Off

Here is the key insight: the Section 121 exclusion reduces your gain. Your adjusted cost basis also reduces your gain. They work together. Every dollar of tracked capital improvements reduces your gain by a dollar, which means one fewer dollar that needs to be covered by the exclusion. If your gain exceeds the exclusion, each dollar of tracked improvement directly reduces the taxable excess.

At a 15% capital gains rate, every $10,000 in tracked improvements saves you $1,500 in tax. At 23.8% (for high earners), it saves $2,380 per $10,000. Over decades of ownership, tracked improvements of $100,000 or more are entirely common, representing potential tax savings of $15,000 to $23,800 or more.

A Worked Example: Why Every Dollar of Basis Matters

Let's walk through a detailed scenario that illustrates why tracking improvements is valuable even when the Section 121 exclusion applies.

The Setup

Maria and Carlos bought their home 20 years ago for $300,000. They are married and file jointly. The home is now worth $1,100,000. They are planning to sell and want to understand their tax situation.

Scenario A: Without Tracking Improvements

If Maria and Carlos only remember their purchase price and do not track their cost basis:

  • Sale price: $1,100,000
  • Original cost basis (purchase price only): $300,000
  • Capital gain: $1,100,000 - $300,000 = $800,000
  • Section 121 exclusion (married filing jointly): -$500,000
  • Taxable gain: $300,000
  • Federal tax at 15%: $45,000

Scenario B: With Tracked Improvements

Now assume Maria and Carlos diligently tracked their home improvements over 20 years:

  • Kitchen remodel (2010): $40,000
  • New roof (2013): $22,000
  • HVAC replacement (2015): $14,000
  • Bathroom renovation (2018): $18,000
  • New windows (2020): $16,000
  • Qualifying closing costs from purchase: $10,000
  • Total additions to basis: $120,000

Their adjusted cost basis is $300,000 + $120,000 = $420,000.

  • Sale price: $1,100,000
  • Adjusted cost basis: $420,000
  • Capital gain: $1,100,000 - $420,000 = $680,000
  • Section 121 exclusion: -$500,000
  • Taxable gain: $180,000
  • Federal tax at 15%: $27,000

The Savings

By tracking their improvements and closing costs, Maria and Carlos reduced their taxable gain from $300,000 to $180,000. At a 15% capital gains rate, that saves them $18,000 in federal taxes. If they were higher earners subject to the 23.8% rate, the savings would be $28,560.

And they did not spend a single extra dollar to achieve this. They simply tracked the money they were already spending on their home.

Special Situations and Exceptions

The Section 121 exclusion has several nuances that are worth understanding:

Homes Used Partly for Rental or Business

If you rented out your home for a period before (or after) using it as your primary residence, the rules get more complex. Depreciation claimed or allowed during the rental period cannot be excluded under Section 121 and is subject to "depreciation recapture" at a 25% rate. Additionally, gains allocated to periods of "nonqualified use" (generally, time after 2008 when the property was not your primary residence) may not be eligible for the exclusion.

Home Office Depreciation

If you claimed depreciation for a home office, that depreciation must be "recaptured" when you sell, regardless of the Section 121 exclusion. The recaptured depreciation is taxed at a maximum rate of 25%. However, the Section 121 exclusion can still apply to the rest of your gain.

Inherited Homes

Inherited homes generally receive a "stepped-up basis" equal to the fair market value at the date of the decedent's death. If you inherit a home and then use it as your primary residence, you can still claim the Section 121 exclusion after meeting the ownership and use tests. The stepped-up basis often dramatically reduces or eliminates the taxable gain.

Divorce

In a divorce, the spouse who receives the home in the settlement takes the same basis as the couple had. If one spouse continues to live in the home, they can count the time the other spouse owned it toward the ownership test (under the "incident to divorce" transfer rules). However, the departing spouse's exclusion may be limited to $250,000 unless they can use the use test exception for unforeseen circumstances.

How HomeBasis Helps You Plan

Understanding your Section 121 situation should not require a tax degree. HomeBasis includes a "What If I Sold?" estimator that factors in the Section 121 exclusion, your filing status, and your tracked improvements to give you a real-time estimate of your potential tax liability if you sold today.

You can see at a glance how much of your gain is covered by the exclusion, how much would be taxable, and how your tracked improvements are reducing that taxable amount. This is especially valuable for long-term planning: if you are years away from selling, you can see how future improvements might further reduce your eventual tax bill.

The app automatically applies the correct exclusion amount based on your filing status (single or married filing jointly) and shows you the estimated tax impact at both the 15% and 20%+ NIIT rates, so you have a range of possible outcomes.

Key Takeaways

The Section 121 exclusion is the single most valuable tax benefit available to homeowners. Here is what to remember:

  1. You can exclude up to $250,000 (single) or $500,000 (married) in capital gains from the sale of your primary residence.
  2. You must meet the ownership and use tests: own and live in the home for at least 2 of the last 5 years. The periods do not need to be consecutive.
  3. Partial exclusions are available if you had to sell early due to job changes, health reasons, or unforeseen circumstances.
  4. When your gain exceeds the exclusion, the excess is taxed at 15% or 20%, plus potentially 3.8% NIIT for high earners.
  5. Tracked capital improvements directly reduce your taxable gain. They work alongside the exclusion, not instead of it.
  6. Start tracking today. Even if you think the exclusion will cover your gain, markets change, filing statuses change, and the cost of tracking is zero while the potential savings are substantial.

For a complete understanding of how your cost basis is calculated, read our guide to home cost basis. To learn which home projects qualify as capital improvements, see our capital improvement vs. repair breakdown. And when you are ready to sell, our selling your home tax guide walks you through the entire process from start to finish.

Start tracking your home's tax basis today

Free to use. No subscription required.

Download on theApp Store
Disclaimer: This is educational content, not tax advice. Consult a qualified tax professional for your specific situation.