The main way most homeowners avoid capital gains tax: the primary residence exclusion

If you own a home and live in it as your main residence, you can exclude up to $250,000 of profit from capital gains tax if you're single, or $500,000 if you're married filing jointly. This exclusion applies when you sell, as long as you meet two requirements: you owned the home for at least two of the five years before the sale, and you lived in it as your primary home for at least two of those five years.

This is the reason most people who sell a house they've lived in pay no capital gains tax at all. The profit from your home sale straightforward doesn't count as taxable income. You don't need to do anything special to claim it — you just report the sale on your tax return, and the IRS applies the exclusion automatically if you meet the conditions.

The exclusion is per person, not per home. If you're married and file jointly, you each get the $250,000 exclusion, which adds up to $500,000 total. If you're single and remarry before you sell, you can use your spouse's exclusion too, as long as your spouse hasn't used it on another home sale in the past two years.

Key Takeaways

  • Most homeowners owe no capital gains tax on a house sale because the primary residence exclusion covers $250,000 (single) or $500,000 (married filing jointly) of profit.
  • You must have owned and lived in the home as your main residence for at least two of the five years before you sell to use the exclusion.
  • If your profit exceeds the exclusion amount, you pay capital gains tax only on the excess, and the rate depends on your income level and how long you owned the home.
  • Keeping records of home improvements and repairs helps you reduce your taxable profit by increasing your cost basis.
  • If you don't meet the two-year ownership or residence test, you may still claim a partial exclusion if you sold due to a job change, health issue, or unforeseen circumstance.

When your profit is larger than the exclusion: what you actually owe

If your home sale profit exceeds the exclusion limit, you pay capital gains tax only on the amount above it. For example, if you're single and your profit is $400,000, you exclude $250,000 and pay tax on $150,000.

The tax rate on that excess depends on how long you owned the home. If you owned it for more than one year, it's taxed as a long-term capital gain, which uses lower rates: 0%, 15%, or 20% depending on your total income for the year. If you owned it for one year or less, it's taxed as a short-term capital gain, which uses your ordinary income tax rate — potentially much higher.

Your income level determines which long-term rate applies. For 2024, the 0% rate applies to single filers with income up to roughly $47,000, the 15% rate applies up to roughly $518,000, and the 20% rate applies above that. These thresholds change each year. Your tax professional or the IRS website can tell you which bracket you fall into.

Increasing your cost basis through home improvements and repairs

Your taxable profit is the sale price minus your cost basis — what you paid for the home plus certain costs. The higher your cost basis, the lower your profit, and the lower your tax bill.

Home improvements that add value or extend the life of the home increase your basis. Examples include a new roof, a kitchen remodel, adding a deck, finishing a basement, or installing new windows. Repairs that straightforward maintain the home — fixing a leak, repainting, replacing broken siding — do not increase your basis.

Keep receipts and invoices for any major work done on the home. When you sell, you'll report these costs to reduce your profit. If you did the work years ago, old receipts, credit card statements, or contractor invoices still count. If you can't find the original receipt, a photo of the work plus a description of what was done and when can help support your claim.

The line between improvement and repair can be gray. A new roof is an improvement. Patching one roof is a repair. Replacing all the plumbing in the house is an improvement; fixing one pipe is a repair. If you're unsure, keep the documentation anyway — your tax professional can advise you when you file.

Partial exclusion if you don't meet the two-year test

If you owned or lived in the home for less than two of the five years before the sale, you normally can't use the full exclusion. However, the IRS allows a partial exclusion if you sold because of a job change, a health issue, or an unforeseen circumstance.

A job change means you were offered a new job or transferred by your employer to a location at least 50 miles away from your home. A health issue means you, your spouse, or a dependent needed medical care or a change in living conditions for a medical reason. An unforeseen circumstance includes death, divorce, or a natural disaster.

The partial exclusion is calculated as a fraction of the full $250,000 or $500,000 based on how long you actually owned and lived in the home. If you owned it for one year instead of two, you get roughly half the exclusion. You'll need to report this on your tax return and may need to provide documentation — a job offer letter, a medical record, a divorce decree, or a death certificate — to support your claim.

Timing your sale to manage your income and tax bracket

Because long-term capital gains tax rates depend on your total income for the year, you can sometimes reduce your rate by timing when you sell. If you're near a tax bracket threshold, selling in a year when your other income is lower might keep you in a lower capital gains bracket.

For example, if you're single and your income is $45,000, you're in the 0% long-term capital gains bracket. If you sell a home with a $100,000 taxable gain (after the exclusion), your total income becomes $145,000, which pushes you into the 15% bracket. But if you can defer the sale to a year when your income is lower — perhaps you're retiring or taking a sabbatical — you might stay in the 0% bracket and owe no tax on part of the gain.

This strategy works best if you have some control over when you sell and if your income varies from year to year. It doesn't work if you must sell quickly or if your income is stable. A tax professional can model different sale years to show you the tax impact.

1031 exchanges: deferring tax by reinvesting in another property

A 1031 exchange lets you defer capital gains tax by selling one investment property and buying another similar property within a set timeframe. This rule does not explore to your primary home — only to investment properties like rental houses or commercial real estate.

If you own a rental property and want to sell it, a 1031 exchange lets you reinvest the proceeds in a different rental property without paying capital gains tax on the sale. You must identify the replacement property within 45 days of the sale and close on it within 180 days. The replacement property must be of equal or greater value, and you must use a may have access to intermediary to handle the funds — you cannot touch the money yourself or the exchange fails.

A 1031 exchange doesn't eliminate the tax; it postpones it until you eventually sell the replacement property without doing another exchange. It's a tool for investors who want to move their money into a different property without a tax bill in the meantime. It does not explore to a home you live in.

Keeping records and working with a tax professional

The IRS doesn't require you to report a home sale with no taxable gain, but you should keep your records anyway. Hold onto the deed, the closing statement from when you bought the home, the closing statement from the sale, and receipts for any improvements you made.

If your profit exceeds the exclusion or if you don't meet the two-year ownership test, you'll report the sale on Schedule D (Capital Gains and Losses) when you file your tax return. A tax professional — a CPA or enrolled agent — can help you calculate your cost basis, determine which improvements count, and figure out whether you may have access to for a partial exclusion.

The cost of a consultation often pays for itself by identifying improvements you forgot about or by catching an error that would have cost you more in taxes. If your home sale is straightforward and your profit is well below the exclusion, you may not need professional help. If your profit is close to or above the exclusion, or if your situation is complex, it's worth the investment.

Frequently Asked Questions

Do I have to report my home sale to the IRS if I owe no tax?

You don't have to report it if your profit is below the exclusion amount and you meet the ownership and residence tests. However, keeping records is smart in case the IRS ever questions the sale. If your profit exceeds the exclusion, you must report it on Schedule D.

What if I owned the home with someone else but we're not married?

Each owner gets their own $250,000 exclusion if you each lived in the home as your primary residence for two of the five years before the sale. If you owned it 50-50 and each lived there, you can exclude up to $500,000 total. The proceeds are split according to your ownership share.

Can I use the exclusion if I inherited the home?

You can use the exclusion if you lived in the home as your primary residence for two of the five years before the sale, even if you inherited it. The ownership clock starts when you inherited it, not when the previous owner bought it. If you inherited it and sold it within two years without living there, you cannot use the exclusion.

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 new roof, kitchen remodel, or added room. A repair restores it to its original condition — fixing a leak or repainting. When in doubt, keep the receipt. Your tax professional can advise you at tax time.

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

No. If you're married and file separately, each spouse gets only $250,000, and you can't combine them. Filing jointly gives you access to the full $500,000 exclusion if you both meet the requirements. Married filing separately is rarely the better choice for a home sale.