Capital Gains Tax When You Sell Your Home: The Exclusion and Its Limits

Atlatl AdvisersJune 20266 min read

A spinning top balanced on a flat surface
Tax & Retirement

When you sell your primary residence, Section 121 of the tax code lets you exclude up to $250,000 of gain from federal tax if you file single, or $500,000 if you file jointly, provided you owned and lived in the home for at least two of the five years before the sale. Gain above the exclusion is taxed as long-term capital gain, potentially plus the 3.8% net investment income tax, and Wisconsin taxes the excess as well after a partial exclusion. For owners of long-held or highly appreciated homes, the exclusion often covers far less than people assume.

How does the home sale exclusion work?

The exclusion comes from Section 121 of the Internal Revenue Code. To qualify for the full amount, you must meet two tests during the five years ending on the sale date: an ownership test (you owned the home for at least 24 months) and a use test (it was your principal residence for at least 24 months). The months do not need to be continuous, and for married couples filing jointly, only one spouse must meet the ownership test, but both must meet the use test to claim the full $500,000.

You can use the exclusion repeatedly over your lifetime, but generally only once every two years. If you excluded gain on another home sale within the two years before the current sale, you typically cannot claim the exclusion again.

A surviving spouse gets a meaningful accommodation: under Section 121(b)(4), a widow or widower who has not remarried can still claim the full $500,000 exclusion if the home is sold within two years of the spouse's death and the couple met the requirements immediately before death.

What if you do not meet the two-year tests?

A partial exclusion may be available if you sell early because of a change in employment, health reasons, or unforeseen circumstances such as death, divorce, or multiple births from a single pregnancy. The IRS applies a distance safe harbor for job moves (the new workplace must be at least 50 miles farther from the home than the old one) and a physician's recommendation standard for health moves, as described in IRS Publication 523.

The partial exclusion is prorated on the cap, not the gain. If a single filer qualifies after 12 months of use, the maximum exclusion is 12/24 of $250,000, or $125,000. Because the proration applies to the limit rather than to the gain itself, a partial exclusion often still covers the entire gain on a short holding period.

Your gain is probably smaller than the price suggests

Taxable gain is the amount realized minus your adjusted basis, not simply sale price minus purchase price. Three adjustments matter:

  • Selling costs. Real estate commissions, transfer taxes, and certain closing costs reduce the amount realized.
  • Capital improvements. A new roof, an addition, a kitchen renovation, a finished basement, and landscaping with a useful life add to basis. Repairs and maintenance do not. IRS Publication 523 lists the categories.
  • Inherited or gifted interests. Property inherited from a spouse or other decedent generally receives a basis step-up to date-of-death value, which can erase decades of appreciation.

Documentation is the practical constraint. Families who kept receipts and contracts for 30 years of improvements often add six figures to basis; families who did not are stuck estimating, and the IRS can disallow undocumented amounts. We encourage clients to keep a running improvement file for every property they own.

A hypothetical Madison example

Consider a hypothetical married couple who bought a home near Lake Mendota in 1995 for $220,000, invested $130,000 in documented improvements over three decades, and sell in 2026 for $1,250,000 with $70,000 of selling costs.

Item Amount
Amount realized ($1,250,000 less $70,000) $1,180,000
Adjusted basis ($220,000 plus $130,000) $350,000
Total gain $830,000
Section 121 exclusion (joint) ($500,000)
Taxable long-term gain $330,000

Assume the couple has $200,000 of other income. Federally, the $330,000 gain falls in the 15% long-term capital gains bracket, since their taxable income remains below the $613,700 threshold where the 20% rate begins for joint filers in 2026 (IRS Revenue Procedure 2025-32). That is roughly $49,500 of capital gains tax. The 3.8% net investment income tax applies to the lesser of net investment income or modified adjusted gross income above $250,000 for joint filers; here it adds roughly $10,600. Wisconsin allows a 30% exclusion on long-term gains, so about $231,000 is taxed at state rates, costing up to roughly $17,700 at the top 7.65% rate (Wisconsin Department of Revenue Publication 103).

Total tax: roughly $78,000 on an $830,000 gain. Meaningful, but far less than the headline numbers suggest, and a reminder that the exclusion plus careful basis records do most of the work. This example is hypothetical and simplified; actual results depend on your full return.

What about home offices and rental periods?

Depreciation changes the math. Any depreciation claimed after May 6, 1997, whether for a home office or a rental period, cannot be excluded under Section 121. It is taxed as unrecaptured Section 1250 gain at a federal rate of up to 25%, and it may also attract the net investment income tax. If the home office was within the same dwelling unit, you do not have to allocate the rest of the gain, but the depreciation recapture survives.

Renting the home out creates a second issue: nonqualified use. Under Section 121(b)(5), periods after 2008 during which the home was not your principal residence (before it became your residence) reduce the exclusion proportionally. If you bought a rental in 2016, converted it to your residence in 2022, and sell in 2026, the rental years after 2008 make a fraction of the gain ineligible for exclusion regardless of the two-year tests. Renting the home after you move out, within the five-year window, generally does not trigger this rule. The interaction with 1031 exchanges and cost segregation is covered in our article on real estate tax strategies.

Second homes and vacation properties

There is no exclusion for a second home, a lake house, or a vacation condo. Gains are fully taxable as capital gains, and losses on personal-use property are not deductible. Converting a vacation home into your principal residence for two years before selling can earn a partial exclusion, but the nonqualified use rule means the years it served as a second home after 2008 remain taxable. For investment property, a 1031 exchange may defer gain, but a personal residence never qualifies for 1031 treatment.

Key numbers

Item Figure
Exclusion, single filer $250,000
Exclusion, married filing jointly $500,000
Ownership and use tests 2 of the last 5 years
Frequency limit Once every 2 years
Depreciation recapture rate (federal) Up to 25%
Net investment income tax 3.8% above $200,000/$250,000 MAGI
2026 20% capital gains threshold (joint) Above $613,700 taxable income
Wisconsin long-term gain exclusion 30% (60% for qualifying farm assets)

Frequently asked questions

Do I have to report the sale on my tax return?If you receive Form 1099-S from the closing agent, or if any gain is taxable, you report the sale on Form 8949 and Schedule D. If the entire gain is excluded and no 1099-S was issued, reporting is generally not required.

Has the exclusion amount ever been indexed for inflation?No. The $250,000 and $500,000 limits have been fixed since 1997, which is why long-held homes in appreciated markets increasingly produce taxable gain above the exclusion.

Can I use a 1031 exchange on my primary residence?No. Section 1031 applies only to real property held for investment or business use. Mixed-use properties may qualify in part, which calls for professional guidance.

Does Wisconsin honor the federal exclusion?Yes. Wisconsin starts from federal income, so gain excluded under Section 121 is not taxed by the state. Taxable gain above the exclusion qualifies for Wisconsin's 30% long-term capital gain exclusion, per Wisconsin Department of Revenue Publication 103.

What records should I keep?Closing statements from purchase and sale, receipts and contracts for every capital improvement, and records of any depreciation claimed. Keep them for as long as you own the home plus at least three years after you file the return reporting the sale.

My spouse died and the home has appreciated significantly. What should I know?Two things: the surviving spouse can claim the full $500,000 exclusion for two years after death, and in many cases at least half of the home's basis (all of it in community property states) steps up at death. Timing the sale around both rules matters; see our wealth transfer primer for how the step-up works.

How Atlatl Advisers can help

Atlatl Advisers is a boutique multi-family office in Madison, Wisconsin, serving accomplished families as an independent, fee-only, SEC-registered fiduciary. We act as your personal CFO: one coordinated team for investments, financial planning, tax strategy, and estate coordination, organized around our Liquidity, Lifetime, and Legacy framework.

Let’s talk about what your wealth is for.

Whether you are exploring a full advisory relationship or have a single question, we are glad to talk.