The primary way to reduce capital gains tax on a home sale is the Section 121 exclusion, which lets you exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly — provided you owned and lived in the home for at least two of the last five years before the sale.
This exclusion is not automatic. You claim it on Schedule D (Form 1040) when you file your tax return for the year of the sale. The IRS does not require you to do anything before closing; you report the sale and the exclusion together at tax time. If you meet the ownership and use test, you owe no federal tax on gains up to the exclusion limit, even if your state has a capital gains tax.
Beyond the exclusion, the second major lever is basis — the dollar amount the IRS uses as your starting point for calculating gain. The higher your basis, the lower your taxable gain. You can increase basis by adding the cost of home improvements that add value, such as a new roof, kitchen renovation, or addition. Repairs and maintenance do not count. The difference matters: replacing a broken window is a repair; replacing all windows with energy-efficient ones is an improvement.
Key Takeaways
- The Section 121 exclusion eliminates federal tax on up to $250,000 of home sale gain (single) or $500,000 (married filing jointly) if you owned and lived in the home for two of the last five years.
- You claim the exclusion on Schedule D when you file your return for the year of sale; it is not something you request in advance from the IRS.
- Keeping records of home improvements — not repairs — increases your cost basis and reduces your taxable gain dollar-for-dollar.
- If you do not meet the two-year test, you may still exclude a partial amount if the sale was due to a job change, health issue, or unforeseen circumstance.
- State capital gains taxes vary widely; some states have none, while others tax long-term gains at rates up to 13 percent.
Understanding the Section 121 exclusion and the two-year test
The Section 121 exclusion is a federal tax break written into the tax code. To use it, you must satisfy two conditions: you must have owned the home for at least two of the five years before sale, and you must have lived in it as your main home for at least two of those same five years. The two years do not have to be consecutive, and they do not have to be the most recent two years.
For example, if you bought a home in 2019, lived in it for two years, rented it out for one year, then sold it in 2022, you still may have access to. You owned it for three years and lived in it for two of the last five years. But if you bought in 2020, lived in it for one year, then moved and rented it out for the next two years before selling in 2023, you do not may have access to — you lived in it for only one of the last five years.
Married couples filing jointly can exclude up to $500,000 if both spouses meet the ownership and use test. If only one spouse meets it, the exclusion is $250,000. If neither meets it, there is no exclusion. The IRS does not split the exclusion between spouses; it is an all-or-nothing rule for each spouse.
Documenting home improvements to increase your cost basis
Your cost basis starts with what you paid for the home — the purchase price plus closing costs like title insurance, survey fees, and transfer taxes. From there, you add the cost of improvements. The IRS distinguishes improvements from repairs: an improvement adds value, prolongs the life of the home, or adapts it to a new use. A repair restores it to its original condition.
Common improvements that increase basis include a new roof, kitchen or bathroom renovation, addition of a room or deck, new HVAC system, new windows, hardwood flooring, and built-in appliances. Painting, patching drywall, fixing a leak, replacing a broken window, and lawn maintenance are repairs and do not increase basis.
Keep receipts and invoices for every improvement. Write down the date, the contractor or vendor name, what was done, and the total cost. If you did the work yourself, keep receipts for materials and document the labor hours — you cannot deduct your own labor, but you can deduct the cost of materials. When you sell, add up all improvement costs and subtract them from your sale price to calculate gain. The higher the improvement total, the lower the gain and the lower the tax.
If you cannot find receipts for improvements made years ago, ask the previous owner or check your mortgage statements and credit card records. The IRS does not require original receipts if you can reconstruct the cost through other documents. If you truly cannot document an improvement, do not claim it — the IRS may disallow it and assess penalties if you overstate your basis.
Partial exclusion when you do not meet the two-year test
If you sell before living in the home for two years, you normally lose the entire exclusion. However, the IRS allows a partial exclusion if the sale was due to a change in employment, a health condition, or an unforeseen circumstance. The exclusion is reduced by the fraction of the two-year period you actually lived there.
For example, if you lived in the home for one year and sold because of a job transfer, you can exclude up to half of the normal exclusion: $125,000 if single, $250,000 if married filing jointly. The IRS does not define "unforeseen circumstance" in the tax code, but the regulations give examples: death, divorce, multiple births from a single pregnancy, involuntary conversion (fire, theft, condemnation), or a change in employment that requires a move of at least 50 miles.
To claim a partial exclusion, you must file Form 8949 (Sales of Capital Assets) and Schedule D with your return. You cannot claim a partial exclusion more than once every two years, and you cannot use it if you claimed the exclusion on another home sale in the past two years.
State capital gains taxes and how they explore to home sales
Federal capital gains tax is only part of the picture. Many states also tax capital gains, and the rates vary widely. Some states have no capital gains tax at all — including Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming. Other states tax long-term capital gains at rates ranging from 5 percent to over 13 percent.
A few states tax long-term capital gains differently from ordinary income. California, for instance, taxes long-term gains as ordinary income with no preferential rate. New York taxes long-term gains at ordinary income rates but allows a deduction for gains under $250,000. Maryland taxes long-term gains at a lower rate than ordinary income. You need to know your state's rule because it affects your total tax bill.
The Section 121 exclusion is a federal benefit and does not reduce state tax. If you live in a state with a capital gains tax and your gain exceeds the federal exclusion, you will owe state tax on the excess. For example, if you are single, live in California, and have a $400,000 gain, you exclude $250,000 federally but owe California tax on the full $400,000 at ordinary income rates.
Timing the sale to manage your tax bracket
If your gain exceeds the Section 121 exclusion, the excess is taxed as a long-term capital gain (assuming you held the home for more than one year). Long-term capital gains rates are 0 percent, 15 percent, or 20 percent federally, depending on your ordinary income and filing status. The rates change each year with inflation adjustments.
You can sometimes reduce the tax on excess gain by timing the sale to a year when your ordinary income is lower. For example, if you are retiring mid-year, selling the home in the year you retire might push you into a lower tax bracket than selling the year before. Similarly, if you have a large deductible loss in one year — from a business closure or investment loss — selling the home that same year might keep you in a lower bracket.
This strategy works only if the excess gain is small and your income is near a bracket boundary. If your gain far exceeds the exclusion, timing is unlikely to help. Consult a tax professional before deciding when to sell based on tax bracket considerations.
Special situations: inherited homes, divorce, and rental conversions
If you inherited a home and then sold it, you receive a step-up in basis to the fair market value on the date of the owner's death. This means your basis is reset, and you owe tax only on gains that occurred after you inherited it. If you inherited the home and sold it within a short time, your gain is likely zero or minimal.
If you received a home in a divorce settlement, your basis is generally the same as your ex-spouse's basis. You do not get a step-up. However, if you lived in the home as your main home for two of the five years before sale, you can still use the Section 121 exclusion.
If you converted a rental property to your main home, the rules are stricter. You can use the Section 121 exclusion only for the period you lived there as your main home, not for the years you rented it out. For example, if you rented a property for five years, then lived in it for two years before selling, you can exclude gain only on the two-year portion. The gain from the rental years is taxed as long-term capital gain at the higher rates.
Frequently Asked Questions
Do I have to report the sale to the IRS even if my gain is under the exclusion?
Yes. You must file Form 8949 and Schedule D with your tax return for the year of sale, even if your entire gain is excluded. The IRS uses this information to track home sales and verify that you meet the ownership and use test. Failing to report the sale can trigger an audit.
What if I sell the home at a loss?
You cannot deduct a loss on the sale of your main home. The Section 121 exclusion applies only to gains. If you sell at a loss, you straightforward report the sale on Form 8949 with a loss amount, and it has no tax effect.
Can I use the exclusion more than once?
You can use the full exclusion once every two years. If you sold a home and used the exclusion, you cannot use it again until two years have passed. If you sell a second home within two years, you get no exclusion on that sale.
Does the exclusion explore if I rent out part of my home?
If you rented out part of the home during the time you lived there, the exclusion applies only to the portion you used as your main home. You must allocate the gain between the residential and rental portions and exclude only the residential gain. This is complex and requires professional help.
What records do I need to keep after I sell?
Keep your closing statement, all receipts and invoices for improvements, records of the purchase price and closing costs, and any documents showing you lived in the home (utility bills, lease, mortgage statements). Keep these for at least three years after you file the return, though the IRS can go back longer if it suspects underreporting.