The primary residence exemption is a federal tax rule that lets many homeowners keep a large part of their profit, or all of it, tax-free when they sell their main home. The IRS calls it the home sale exclusion. It comes from Section 121 of the Internal Revenue Code.
Here is the basic idea:
- Single filers can exclude up to $250,000 of profit from a home sale.
- Married couples filing jointly can exclude up to $500,000 of profit.
These amounts are set by law and are not adjusted for inflation each year. If your profit is below the limit and you meet the rules, you generally owe no federal capital gains tax on the sale.
How Capital Gains on a Home Work
A capital gain is the profit you make when you sell something for more than you paid. For a home, the math looks like this:
- Start with the sale price.
- Subtract selling costs, such as real estate agent commissions and certain closing costs.
- Subtract your adjusted basis. This is usually what you paid for the home, plus the cost of major improvements like a new roof, an addition, or a remodeled kitchen.
What is left is your gain. If that number is within your exclusion limit, it may be tax-free.
Hypothetical example: Maria, a single homeowner, bought her house for $300,000. She spent $50,000 on a new roof and kitchen. She sells for $620,000 and pays $35,000 in selling costs. Her gain is $620,000 − $35,000 − $350,000 = $235,000. Since that is under $250,000, she may owe no federal tax on the profit.
Keep receipts for improvements. Routine repairs, like fixing a leak or repainting, usually do not add to your basis. Upgrades that add value or extend the home’s life usually do.
Who Qualifies for the Exclusion
To claim the full exclusion, you must pass three tests.
The Ownership Test
You must have owned the home for at least two years during the five years before the sale.
The Use Test
You must have lived in the home as your main residence for at least two years during the five years before the sale. The two years do not have to be in a row. In total, you need 24 months, or 730 days, within that five-year window. Short absences, like vacations, usually still count as time living there.
The Look-Back Test
You generally cannot have used the exclusion on another home sale within the two years before this sale.
Special Rules for Married Couples
To get the full $500,000 exclusion, a married couple filing jointly must meet these conditions:
- At least one spouse meets the ownership test.
- Both spouses meet the use test.
- Neither spouse has used the exclusion in the past two years.
If only one spouse qualifies, the couple may still get up to $250,000.
A surviving spouse may still claim up to $500,000 if the home is sold within two years of the spouse’s death and certain conditions are met, including not remarrying before the sale. After a divorce, a person may be able to count time when an ex-spouse lived in the home under a divorce or separation agreement.
What If You Don’t Meet the Two-Year Rule?
Life does not always follow a five-year plan. If you have to sell early, you may still qualify for a partial exclusion. This applies when the main reason for selling is:
- A job change, such as a new workplace that is far enough away to meet IRS distance rules
- Health reasons, like moving to get care for yourself or a family member
- Unforeseen circumstances, such as a divorce, a death in the family, multiple births from one pregnancy, or a natural disaster
The partial exclusion is based on how much of the two-year period you met. For example, if you lived in the home for 12 months, you may be able to exclude up to half of the full amount.
Military and Government Service Members
Members of the uniformed services, the Foreign Service, and some intelligence community employees on qualified official extended duty can choose to pause the five-year window for up to 10 years. This helps people who are ordered to move away from their home for long periods still qualify when they sell.
Situations That Can Reduce Your Exclusion
Some situations can shrink the amount you can exclude or create taxable gain.
Renting Out the Home or Using It as a Second Home
If you rented the home out or used it as a vacation home before making it your main residence, part of your gain may not qualify. This is called nonqualified use, and it applies to periods after December 31, 2008. Time the home was rented after you moved out generally does not count against you, as long as you still meet the two-out-of-five-year rules.
Depreciation Recapture
If you claimed depreciation for renting the home or using part of it as a home office, that amount generally cannot be excluded. Depreciation taken after May 6, 1997, is usually taxed at a rate of up to 25%.
Gains Above the Limit
Any profit above $250,000 or $500,000 is usually taxed as a long-term capital gain if you owned the home more than one year. Higher-income sellers may also owe the Net Investment Income Tax on the taxable part of the gain. The income thresholds and tax brackets for these taxes can change, so check the rules for the tax year of your sale.
Things the Exclusion Does Not Cover
- Second homes and vacation homes that were never your main residence do not qualify.
- Investment properties do not qualify. Investors sometimes use a 1031 exchange instead, but that does not apply to a personal main home.
- Losses on the sale of a personal home are not tax-deductible.
Do You Have to Report the Sale?
If your whole gain is excluded and you did not receive a Form 1099-S, you often do not need to report the sale on your federal return. If you do get a Form 1099-S, or if part of your gain is taxable, you will usually report the sale on Form 8949 and Schedule D. State tax rules can be different, so check your state’s rules too.
Tips to Make the Most of the Exclusion
- Track your move-in and move-out dates. These prove you meet the use test.
- Save records of home improvements. A higher basis means a smaller gain.
- Plan your timing. Waiting a few extra months to pass the two-year mark could save a lot in taxes.
- Think before renting out your home. Renting can affect your exclusion and create depreciation recapture.
- Talk to a tax professional. Tax rules have many details, and a CPA or enrolled agent can confirm how they apply to you.
How a Mortgage Broker Can Help When You Sell and Buy
Selling your main home is often the first step toward buying the next one. The tax-free profit from your sale can become a strong down payment, which may help you get better loan terms or avoid private mortgage insurance on a conventional loan.
A mortgage broker can be a helpful partner here. Brokers work with many lenders, not just one. That means they can:
- Compare loan options from several lenders to find a good fit.
- Help with timing, such as bridge loans if you need to buy before your current home sells.
- Explain lender requirements, since some lenders set stricter rules, called overlays, than the basic program guidelines.
- Guide you through documents, such as showing where your down payment money came from after a home sale.
Pairing good tax planning with smart mortgage shopping can help you keep more of your home’s value and move into your next home with confidence.
Related mortgage answers
Helpful guides
Have a question about your situation?
Ask Morty, our free mortgage assistant, and get an answer for your numbers in plain English.
This answer is general information, not financial, tax or legal advice. Any rates shown are illustrative averages or examples, not a quote, and real rates change daily. Talk with a licensed mortgage professional about your situation.