The Primary Route: The Section 121 Exclusion

The most direct way to avoid capital gains tax on a house sale is the Section 121 exclusion, a federal rule that lets you exclude up to $250,000 of profit if you are single, or $500,000 if you are married filing jointly. You do not owe tax on that amount at all — it simply does not count as income.

To use this exclusion, you must have owned the home and lived in it as your primary residence for at least two of the five years before you sell. The two years do not have to be consecutive. If you meet these requirements, you file Form 8949 and Schedule D with your tax return to report the sale and claim the exclusion. The IRS does not require you to do anything special in advance — you claim it when you file.

Most homeowners who sell a primary residence never pay capital gains tax because their profit falls below the exclusion limit. If you bought for $300,000 and sold for $450,000, your profit is $150,000, which is entirely covered by the $250,000 exclusion for a single filer.

Key Takeaways

  • The Section 121 exclusion covers up to $250,000 (single) or $500,000 (married) of home sale profit and requires you to have owned and lived in the home for two of the past five years.
  • If your profit exceeds the exclusion, you owe long-term capital gains tax on the remainder, which is lower than ordinary income tax rates but still substantial.
  • Timing your sale around the two-year ownership requirement can mean the difference between owing nothing and owing thousands in tax.
  • Keeping records of home improvements, repairs, and the original purchase price is essential because these reduce your taxable profit.
  • If you do not meet the two-year test, you may still claim a partial exclusion if you sold due to a job change, health issue, or unforeseen circumstance.

When Your Profit Exceeds the Exclusion Limit

If your home sale profit is larger than $250,000 (or $500,000 if married), you owe long-term capital gains tax on the excess. The rate depends on your total income for the year and ranges from 0% to 20%, plus a 3.8% net investment income tax if your income is above certain thresholds. This is lower than ordinary income tax rates, but the amount owed can still be significant.

For example, if you are single, sold for a $400,000 profit, and your income puts you in the 15% long-term capital gains bracket, you would owe tax on $150,000 of profit (the amount over the $250,000 exclusion). That is $22,500 in federal tax, before state taxes.

The only way to reduce this tax is to increase your cost basis — the amount you originally paid plus the cost of improvements you made. Replacing a roof, adding a deck, or renovating a kitchen counts. Repairs that simply restore the home to its original condition do not. You need receipts and documentation to prove these expenses to the IRS if audited.

Documenting Home Improvements To Lower Your Tax

Every dollar you spent on capital improvements reduces your profit dollar-for-dollar. If you spent $50,000 on improvements over the years you owned the home, your profit is $50,000 lower, which means $50,000 less in taxable gain.

Keep receipts, invoices, and contracts for any work done. The IRS distinguishes between improvements (which add value or extend the life of the home) and repairs (which maintain it). A new roof is an improvement. Patching a roof is a repair. A kitchen renovation is an improvement. Fixing a leaky faucet is a repair. When in doubt, save the documentation — you may need it years later when you sell.

If you have been in the home for many years, gather old receipts, credit card statements, and cancelled checks. If you cannot find original paperwork, a contractor or supplier may have records. The effort to document $10,000 or $20,000 in improvements can save you thousands in tax.

The Partial Exclusion for Hardship Situations

If you do not meet the two-year ownership and residence test, you may still claim a partial exclusion if you sold because of a job change, health issue, or unforeseen circumstance. The IRS calls this the hardship exception.

You calculate the partial exclusion by multiplying the full exclusion ($250,000 or $500,000) by a fraction: the number of months you owned and lived in the home divided by 24. If you owned the home for 12 months and sold due to a job relocation, you could exclude half the normal amount — $125,000 if single.

To claim this, you file Form 8949 and Schedule D and attach a statement explaining the reason for the sale. The IRS does not pre-approve hardship claims; you claim it on your return and keep documentation in case of audit. Acceptable reasons include a job change to a new location, a significant health issue requiring a move, divorce, or death in the family. Job loss alone typically does not may have access to.

Timing Your Sale To Meet the Two-Year Test

If you are close to the two-year mark, delaying the sale by a few months can mean the difference between owing tax and owing nothing. The two years do not have to be consecutive, but they must fall within the five years before the sale.

If you bought in January 2022 and are thinking of selling in December 2023, you have only 23 months of ownership. Waiting until January 2024 gives you 24 months and qualifies you for the full exclusion. That delay could save thousands in tax if your profit is large.

This strategy only works if you can afford to wait and if the housing market or your personal situation allows it. If you need to sell sooner, you may owe tax on part of the gain, but the partial hardship exclusion might still reduce it.

State and Local Taxes on Home Sales

The Section 121 exclusion applies only to federal income tax. Most states do not tax capital gains on home sales, but a few do. California, New York, Oregon, and Washington state tax capital gains at rates ranging from 5% to 13.3%, depending on the state and your income level. These taxes apply to the same profit amount that federal tax applies to.

If you live in a state with capital gains tax and your profit exceeds the federal exclusion, you will owe state tax on the excess. There is no state-level exclusion comparable to Section 121 in most places. Check your state's tax authority website or speak with a tax professional in your state to understand your specific liability.

When To Consult a Tax Professional

If your home sale profit is modest — under $100,000 — and you meet the two-year test, you almost certainly owe no federal tax and can file on your own. If your profit is larger, if you do not meet the two-year test, if you have substantial home improvements to document, or if you live in a state with capital gains tax, a tax professional can help you understand what you owe and what documentation you need.

A CPA or tax attorney can also advise on whether a partial hardship exclusion applies to your situation and how to claim it correctly. The cost of a consultation often pays for itself in tax savings or in avoiding an audit.

Frequently Asked Questions

Do I have to live in the house for two years straight, or can the time be broken up?

The two years do not have to be consecutive. You need to have owned and lived in the home for at least two of the five years before you sell. If you owned it for three years, moved out for one year, then sold, you still may have access to because you lived there for three of the five years.

What counts as a home improvement versus a repair?

An improvement adds value, prolongs the life of the home, or adapts it to a new use. A roof replacement, deck addition, or kitchen renovation counts. A repair restores something to working order — patching a roof, fixing drywall, or replacing a broken window. When in doubt, keep the receipt. The IRS looks at whether the work was necessary to maintain the home or whether it enhanced it.

If I am married but file separately, do I get the full $500,000 exclusion?

No. If you are married and file separately, each spouse gets only $250,000. Filing jointly gives you $500,000 combined. Filing separately is almost never advantageous for capital gains on a home sale.

Can I use the exclusion more than once?

You can use it once every two years. If you sold a home in 2022 and claimed the exclusion, you cannot claim it again until 2024. This rule prevents people from buying and selling homes frequently to repeatedly avoid tax.

What if I inherited the home — does the two-year rule still apply?

No. If you inherited the home, you receive a stepped-up basis, meaning your cost basis is the home's value on the date of death, not what the previous owner paid. You owe capital gains tax only on appreciation after you inherited it. You still need to own and live in it for two of the five years before sale to use the Section 121 exclusion on that post-inheritance gain.