
Educational content only — not financial advice. Consult a qualified professional before making decisions.
Home Sale Capital Gains Exclusion: How It Works


Educational content only — not financial advice. Consult a qualified professional before making decisions.

You've Lived in Your Home for 25 Years. The Tax Bill Could Still Surprise You.
For many Americans, the family home is both a deeply personal place and a significant financial asset. If you purchased your home in the 1990s or early 2000s, you may be sitting on hundreds of thousands of dollars in unrealized gains. The good news is that federal tax law provides a meaningful exclusion designed specifically for this situation. The less comfortable news is that the exclusion has limits, the rules have nuance, and the gains above the threshold do not disappear.
This guide walks through how the Section 121 exclusion actually works, what you need to qualify, how to think about gains that exceed the threshold, and several commonly overlooked details that can make a meaningful difference to your tax outcome.
Step 1: Understand What the Exclusion Covers
Under Internal Revenue Code Section 121, qualifying homeowners can exclude a portion of the capital gain from the sale of a primary residence from federal income tax. The exclusion amounts, as set by the IRS, are:
To be clear, these figures refer to the gain on the sale, not the sale price itself. Your gain is calculated as the difference between your adjusted sale price (after selling costs) and your adjusted cost basis in the property. We will come back to why that distinction matters considerably.
It is also worth noting that this exclusion applies to federal income tax only. Some states have their own rules regarding the taxation of home sale gains, so the state-level picture may look different depending on where you live.

Step 2: Confirm You Meet the Ownership and Use Tests
Qualifying for the exclusion is not automatic. The IRS requires that you satisfy two distinct tests during the five-year period ending on the date of the sale. Both tests must be met.
The Ownership Test
You must have owned the home for at least 24 months (two years) out of the five years before the sale. The two years do not need to be consecutive. Periods of ownership can be added together as long as they fall within the five-year window.
The Use Test
You must have used the home as your primary residence for at least 24 months out of the same five-year window. Again, this does not need to be a continuous stretch. Short absences, such as a temporary job relocation or a stay in a care facility for less than two years, may not break the use test, though the IRS rules in this area have specific conditions.
For a married couple filing jointly, both the ownership and use tests apply somewhat differently. Only one spouse needs to satisfy the ownership test, but both spouses must independently satisfy the use test to access the full $500,000 exclusion. If only one spouse meets the use test, the couple's combined exclusion is limited to $250,000.
One important practical note: the exclusion can generally only be used once every two years. If you sold another home and claimed the exclusion within the prior two years, you may not be eligible to claim it again on a new sale.
Step 3: Calculate Your Adjusted Cost Basis (This Is Where Most People Leave Money on the Table)
Your taxable gain is not simply the difference between what you paid and what you sell for. It is the difference between your adjusted sale proceeds and your adjusted cost basis. That distinction is significant, and many long-tenured homeowners unknowingly overpay tax by failing to account for it correctly.
Your adjusted cost basis starts with what you originally paid for the home. From there, it can be increased by:
To illustrate with a hypothetical example: consider a couple who purchased their home in 1998 for $200,000. Over the years, they spent $80,000 on a kitchen renovation, a bathroom addition, and a new HVAC system. Their adjusted cost basis is therefore $280,000, not $200,000. If they sell for $900,000, their gain is $620,000, not $700,000. With the $500,000 married filing jointly exclusion, their taxable gain drops to $120,000 rather than $200,000. That difference in record-keeping translates directly into lower taxes.
The challenge is documentation. Receipts, contractor invoices, and permits from projects completed decades ago are not always easy to locate. A common starting point is to gather whatever records are available and work with a tax professional to reconstruct the basis as accurately as possible before the sale, not after.
Step 4: Know What Happens to Gains Above the Exclusion
Run your numbers in five minutes. No bank login, no credit card.
If your gain exceeds the applicable exclusion threshold, the portion above the limit is subject to federal capital gains tax. For most homeowners who have lived in their property for more than a year, this qualifies as a long-term capital gain, which is generally taxed at more favorable rates than ordinary income.
As of 2024, the federal long-term capital gains tax rates are:
There is one additional layer to be aware of. Higher-income taxpayers may also owe the Net Investment Income Tax (NIIT), which is an additional 3.8% on net investment income for individuals with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly). A large home sale gain can push some sellers into NIIT territory even if they would not ordinarily be subject to it. The IRS provides details on the NIIT at irs.gov.
For homeowners with gains well above the exclusion threshold, the year of the sale is worth careful planning. A large taxable gain in a single year can interact with other elements of your modified adjusted gross income, potentially affecting Medicare premiums, ACA subsidy eligibility, and other income-tested benefits. Discussing the timing and structure of a sale with a tax professional ahead of listing is a consideration many advisers highlight for long-tenured owners.
Step 5: Understand the Partial Exclusion for Certain Qualifying Moves
What if you need to sell before meeting the two-year ownership or use requirements? In certain circumstances, the IRS allows a partial exclusion rather than requiring you to forfeit the benefit entirely.
A partial exclusion may be available if the primary reason for the sale falls into one of three qualifying categories:
When a partial exclusion applies, the amount you can exclude is proportional to how much of the two-year requirement you actually met. For example, if a single filer sells after living in the home for 12 months instead of 24, and qualifies under the employment change rule, they may be eligible to exclude up to $125,000 (half of the $250,000 maximum, reflecting 12 of the required 24 months). These rules have specific conditions and the IRS guidance in Publication 523 covers them in detail.
A Special Consideration for Surviving Spouses
For married homeowners, the interaction between the Section 121 exclusion and the death of a spouse deserves specific attention. Under current tax law, a surviving spouse may be eligible for the full $500,000 exclusion on a home sale, rather than the $250,000 single-filer amount, provided that:
This two-year window is meaningful. A surviving spouse who waits longer than two years to sell will generally be limited to the $250,000 single-filer exclusion, which could result in a substantially higher tax bill on the same transaction. This is one reason why estate and financial planning conversations often include a discussion of the home, not just investment accounts.
It is also worth noting that a surviving spouse often receives a stepped-up cost basis on the deceased spouse's share of the property at the time of death, which can reduce the gain significantly. The rules around stepped-up basis depend on how the property was titled and which state you live in, making this an area where working with both a tax adviser and an estate attorney is particularly valuable. For broader estate and beneficiary planning considerations, our post on beneficiary designations is a useful companion read.
Common Misconceptions Worth Addressing
A few widespread misunderstandings tend to surface when long-tenured homeowners begin researching this topic.
Misconception 1: The exclusion applies to the sale price, not the gain.
The $250,000 and $500,000 figures refer to the gain, not the total proceeds. A homeowner selling for $900,000 is not exempt from tax simply because the exclusion sounds large. What matters is the difference between the adjusted sale proceeds and the adjusted cost basis.
Misconception 2: Ordinary repairs count toward basis.
Only capital improvements, those that add value, extend the home's useful life, or adapt it to a new use, can be added to your cost basis. Painting, fixing a broken appliance, or replacing a worn carpet are generally considered maintenance and do not increase your basis. The IRS addresses this distinction in Publication 523.
Misconception 3: The exclusion is automatic.
You must actively claim the exclusion on your tax return (or choose not to, if it is more advantageous to do so in some unusual circumstance). You report the sale on IRS Form 8949 and Schedule D. If your gain is fully excluded and you receive a Form 1099-S, you still need to report the transaction.
Misconception 4: Moving in temporarily before the sale qualifies you.
The use test requires genuine, primary-residence occupancy. A temporary move-in designed primarily to access the exclusion is unlikely to satisfy the IRS's standards and could attract scrutiny.
For homeowners also considering whether equity should factor into a broader retirement income plan, it may be useful to explore how reverse mortgages work as a separate, though quite different, option for accessing home equity.
Selling the family home is rarely just a financial transaction. For most long-tenured homeowners, it comes layered with personal significance and meaningful financial consequences. The Section 121 exclusion is one of the more generous provisions in the tax code, but it rewards preparation. Knowing your adjusted cost basis, keeping documentation of improvements, and understanding how your filing status and timing interact with the rules can all affect the outcome in ways that are worth planning for well in advance of a sale.
This article is intended as general educational information only and does not constitute personalised tax or financial advice. Tax rules are complex and individual circumstances vary. Readers are strongly encouraged to consult a qualified tax professional or financial adviser before making decisions related to the sale of a home or any other significant financial transaction.
Use fidser's free retirement planning tools to explore how proceeds from a home sale could support your income in retirement.
Get Started Free
By fidser.

