Home sale · beginner · 9 min
Avoid Capital Gains Tax on a House: 7 Ways (2026)
Updated 2026-10-12
Educational only. Not tax advice.
Short answer
You can exclude up to $250,000 of gain on a main home in 2026, or $500,000 if you file jointly, when you owned and lived there for 2 of the last 5 years. The other six ways change basis, timing, or the type of property. None of them erases tax by itself.
Key takeaways
- The largest lever for a main home is the Section 121 exclusion.
- Improvements and selling costs change the gain before any exclusion.
- A rental uses the 1031 path, not the home exclusion.
- In the example, tax falls from $48,080.00 to $4,500.00.
- Installment sales and the seniors myth are named here and are not linked, because those pages are not live.
Before you start
- Section 121 exclusion
- Section 121 lets you exclude up to $250,000 of gain on a main home, or $500,000 on a joint return, after the ownership and use tests.
- Adjusted basis
- Adjusted basis starts with the purchase price, adds improvements, and subtracts depreciation on a rental. Selling costs reduce the amount realized.
Live there 2 of the last 5 years
Own the home for at least 2 years of the 5 years before the sale. Live in it as your main home for at least 2 years of that same period. The two periods do not have to be continuous, and they do not have to be the same months.
The cap is $250,000 for a single filer and $500,000 for a joint return. Gain above the cap is taxable. The Section 121 guide is the home for the tests. This page does not repeat every exception.
Add improvements to basis
A new roof, a room addition, and a replaced system add to basis. A repair that only keeps the home in working order does not. Higher basis means a smaller gain.
Keep invoices. The calculator has a field for improvement costs. Do not put repairs in that field.
Count selling costs
Real estate commission, transfer taxes, and other selling costs reduce the amount you realized. A lower amount realized means a smaller gain.
Do not subtract the same commission twice. If the closing statement already netted it from the price, leave the selling-cost field at zero.
Time the sale
A sale after you have held the property more than one year uses the long-term rates. A sale on the anniversary date is still short-term. Other taxable income fills the brackets first.
Waiting can also finish the 2-of-5 test. Selling a month early can lose the exclusion. Count the months before you list the home. A calendar, not a guess, should decide the date. Write that date down.
Use a 1031 exchange for investment property
Section 121 is for a main home. A rental or other investment property uses the like-kind rules when you want to defer gain. You identify a replacement within 45 days and you close within 180 days.
The 1031 guide covers the clocks. The calculator can compare a taxable sale with a full rollover. It does not hold the funds or file Form 8824.
Offset the gain with losses
Capital losses offset capital gains. A loss in a taxable brokerage account can reduce the taxable part of a home sale that remains after the exclusion.
A loss inside an IRA does not create a current capital loss. The wash-sale rule can disallow a securities loss if you buy the same investment again too soon. The loss carryover guide is the home for the $3,000 limit.
Spread the gain with an installment sale
An installment sale reports gain as you receive principal. Form 6252 is the form. Interest you receive is not capital gain.
This site does not have an installment-sale page yet. The sentence above is plain text. A link will be added when that page is live. Do not treat this paragraph as a filled Form 6252.
What does not work
There is no extra home exclusion that starts at age 55. That rule was repealed. A page about the seniors myth is not live, so this sentence does not link to it.
Moving to another state does not erase federal tax. A 1031 exchange does not apply to a main home you treat as a personal residence. Buying a replacement house is not required for Section 121.
One sale, before and after the exclusion
The example is a single filer. Taxable income before the gain is $80,000. The home was bought for $200,000 on 15 January 2024 and sold for $480,000 on 15 June 2026. The gain is $280,000 and the holding period is long-term.
Without the exclusion, federal tax plus NIIT is $48,080.00. With the 2-of-5 tests met, the exclusion is $250,000.00 and federal tax plus NIIT is $4,500.00. The home sale calculator is the current page. The unpublished rebuild is not linked.
| Case | Federal tax plus NIIT |
|---|---|
| No exclusion | $48,080.00 |
| 2 of 5 years met | $4,500.00 |
Worked example
$3,082.50
Long-term federal tax on the gain. NIIT is $0.00.
Enter these numbers