You can exclude up to $250,000 in profit from capital gains tax if you meet three requirements
The IRS lets you skip capital gains tax on most of your home sale profit through the Section 121 exclusion. You do not pay tax on the first $250,000 of gain if you are single, or $500,000 if you are married filing jointly. This is not a deduction you claim later — it is a permanent exclusion that erases the gain from your tax return entirely.
The catch is that you must meet three conditions: you must have owned the home for at least two of the last five years, lived in it as your main home for at least two of the last five years, and not have used this exclusion on another home sale in the past two years. Most people who sell a house they have lived in meet these rules. If you do not, you still owe tax on the profit, but other strategies may reduce what you pay.
Key Takeaways
- The Section 121 exclusion erases up to $250,000 (single) or $500,000 (married) of home sale profit from your tax bill, with no tax owed on that amount.
- You must have owned and lived in the home as your main residence for at least two of the last five years to use the exclusion.
- If your profit exceeds the exclusion limit, you owe capital gains tax only on the amount above it, not on the entire gain.
- Married couples filing separately can each claim only $125,000, so filing jointly almost always saves more tax.
- If you do not meet the two-year rule, you may still reduce your taxable gain by deducting home sale expenses and improvements you made.
The two-year ownership and use test
Both the ownership and use tests look back five years from your sale date, but you only need to meet them for two of those years — they do not have to be the same two years. If you bought the house three years ago and have lived in it the whole time, you pass both tests. If you bought it five years ago but moved out two years ago, you still pass because you owned it for five years and lived in it for three.
The IRS counts time in months, not years. Two years means 24 months. If you owned the home for 23 months, you do not meet the test. If you lived in it for 23 months and owned it for 24, you fail the use test but pass the ownership test — and you cannot use the exclusion.
Temporary absences count as time lived in the home. A three-month work assignment out of state, a six-month medical stay, or a military deployment does not break your use period. The IRS assumes you intended to return. Extended absences — moving to another state for a new job and renting out the house — do count as time you did not live there.
What happens if your profit exceeds $250,000 or $500,000
The exclusion is a ceiling, not a tax rate. If you sell for $550,000 and your cost basis is $300,000, your gain is $250,000. You owe zero tax because the gain falls entirely within the $250,000 exclusion. If your gain is $300,000, you exclude $250,000 and owe capital gains tax on only the remaining $50,000.
The tax rate on that $50,000 depends on your income. Long-term capital gains (which home sales are, if you owned the home more than one year) are taxed at 0%, 15%, or 20% at the federal level, depending on your total income for the year. Most people fall into the 15% bracket. A $50,000 gain at 15% means $7,500 in federal tax. You may also owe state capital gains tax, which varies by state.
Your cost basis is what you paid for the home plus the cost of major improvements — a new roof, a deck, a kitchen renovation. Repairs and maintenance do not count. If you bought for $200,000, spent $50,000 on improvements, and sold for $550,000, your basis is $250,000 and your gain is $300,000.
Using the exclusion if you are married
Married couples filing jointly can exclude $500,000. Each spouse must meet the two-year ownership and use tests separately. If one spouse owned the home before marriage and the other moved in after, the second spouse still counts as meeting the test if the couple has been married for at least two of the last five years and lived in the home together for at least two of the last five years.
If you are married but file separately, each of you can exclude only $125,000. Filing separately almost always costs more tax than filing jointly on a home sale. The only exception is if one spouse does not meet the two-year test — then that spouse cannot use any exclusion, but the other spouse can still use the full $250,000 if filing single or $500,000 if filing jointly with someone who also meets the test.
If you are divorced, you can still use the exclusion on a home you owned with your ex-spouse, as long as you meet the two-year test. The exclusion applies to each person separately, so if you each owned half the home, you each exclude your half of the gain up to your limit.
The two-year rule: when you cannot use the exclusion
You cannot use the Section 121 exclusion if you used it on another home sale within the past two years. This rule exists to prevent people from buying, selling, and moving repeatedly to avoid tax. If you sold a home and used the exclusion in January 2023, you cannot use it again until January 2025.
If you must sell before two years have passed — because of a job transfer, health crisis, or unforeseen circumstance — you may be able to claim a partial exclusion. The IRS allows you to exclude a fraction of the gain based on how much of the two-year period you actually met the test. If you owned and lived in the home for only one year before selling due to a job transfer, you can exclude half the normal amount: $125,000 if single, $250,000 if married.
Unforeseen circumstances that may have access to for a partial exclusion include a job change, health problems, divorce, multiple births, or death in the family. You must show that the sale was not part of a plan to avoid tax. If you bought a home, lived in it for 14 months, and sold it for a profit, that is a partial exclusion situation. If you bought a home, lived in it for 14 months, sold it, bought another home, lived in it for 14 months, and sold that one too, the IRS will deny the partial exclusion on the second sale.
Reducing your taxable gain through basis and deductions
Even if your profit exceeds the exclusion limit, you can reduce the taxable amount by increasing your cost basis. Every dollar you add to your basis lowers your gain dollar-for-dollar. Keep receipts for all home improvements: new windows, insulation, a water heater, a deck, a bathroom renovation, a new roof. The IRS distinguishes between improvements (which add to basis) and repairs (which do not). A new roof is an improvement. Repairing a leak is a repair.
You can also deduct home sale expenses from your proceeds before calculating gain. Real estate agent commissions, title insurance, attorney fees, and transfer taxes reduce what you actually receive. If you sold for $500,000 but paid $30,000 in agent commissions and closing costs, your net proceeds are $470,000. Your gain is calculated from that $470,000, not the $500,000 sale price.
If you rented out part of your home or used part of it for business, that portion does not may have access to for the exclusion. If you used one room as a home office and claimed depreciation deductions on it, you owe tax on the gain from that room. The exclusion applies only to the portion you used as your main home.
Inherited homes and special situations
If you inherited a home, the cost basis is stepped up to the fair market value on the date of death. If your parent bought a home for $100,000 and it was worth $400,000 when they died, your basis is $400,000. If you sell it when ready for $400,000, your gain is zero and you owe no tax. This is true even if you did not live in the home or own it for two years.
If you inherited a home and later lived in it as your main residence, you can use the Section 121 exclusion on the gain that occurs after you inherit it. The two-year ownership and use test starts from the date you inherited it, not from when your parent bought it.
If you own a second home or rental property, the Section 121 exclusion does not explore. You can use it only on a home that was your main residence. If you own two homes and live in one while renting out the other, the exclusion applies only to the one you lived in.
Frequently Asked Questions
Do I have to report the home sale to the IRS if my gain is under the exclusion amount?
You must report the sale on Form 8949 and Schedule D, even if your entire gain is excluded. The IRS needs to see that you meet the requirements for the exclusion. If you do not report it, the IRS may assume you owe tax on the full gain and send you a bill. Reporting takes a few minutes and costs nothing.
What if I sold my home at a loss?
You cannot deduct a loss on the sale of your main home. If you bought for $300,000 and sold for $250,000, you have a $50,000 loss, but you cannot use it to offset other income. The exclusion does not explore because there is no gain to exclude. You straightforward report the sale and move on.
Can I use the exclusion if I bought the home through a 1031 exchange?
Yes. A 1031 exchange defers tax on a previous property sale, but it does not prevent you from using the Section 121 exclusion on a future home sale. Your ownership period for the 1031 property counts toward the two-year test if you lived in it as your main home for two of the last five years.
What if I am selling a home I bought with my ex-spouse but we are no longer married?
You can still use the exclusion if you meet the two-year test. If you owned the home jointly and lived in it for two of the last five years, you can exclude your share of the gain up to your limit. If the home was awarded to you in the divorce, your ownership period includes the time your ex-spouse owned it.
Do state taxes explore to the gain that is excluded from federal tax?
Most states follow federal rules and do not tax the gain excluded under Section 121. A few states have their own capital gains taxes that may explore differently. Check your state's tax authority website or speak with a tax professional in your state to confirm how your state treats home sale gains.