Primary Residence Exclusion: The Section 121 Capital Gains Rule on Home Sales
- What Is the Section 121 Primary Residence Exclusion?
- Who Qualifies for the $250,000 or $500,000 Home Sale Exclusion?
- How Does the 2 Out of 5 Year Rule Work?
- How Do You Prove You Lived in the Home as Your Primary Residence?
- What If You Don't Meet the 24-Month Tests? Partial Section 121 Exclusion
- How Does the Primary Residence Exclusion Work When You Sell a Home Abroad?
- How Do You Calculate Your Taxable Gain on a Home Sale?
- How Do You Report the Home Sale on Your Tax Return?
- How Do the Foreign Tax Credit, State Tax, and NIIT Affect Any Taxable Portion?
- What's the Difference Between a Section 121 Exclusion and a 1031 Exchange?
- Is There a "6-Year Rule" for the Primary Residence Exclusion in the U.S.?
- Can You Have More Than One Primary Residence?
- What Mistakes Do Homeowners Make With the Section 121 Exclusion?
- When to Bring in an Expat Tax Professional
- Frequently Asked Questions
- Related Resources
The primary residence exclusion lets you exclude up to $250,000 of capital gain from federal income tax when you sell your main home, or up to $500,000 if you are married filing jointly. The rule is codified in Internal Revenue Code Section 121, detailed in IRS Publication 523, and summarized in IRS Topic 701. A U.S. citizen or green card holder can claim it on a primary residence located anywhere in the world, and for most homeowners, including expats selling a home overseas, it eliminates the federal capital gains tax on the sale entirely. The exclusion is also known as the Section 121 exclusion or the home sale exclusion.
You qualify for the full exclusion when all of the following are true:
- Ownership: You owned the home for at least 24 months during the 5 years before the sale.
- Use: You lived in the home as your principal residence for at least 24 months during that same 5-year window (the “2 out of 5 year rule”).
- Frequency: You have not claimed the Section 121 exclusion on another home sold in the last 2 years.
- Acquisition: The home was not acquired through a like-kind (1031) exchange in the last 5 years.
Selling Your Home? Make Sure You Claim Every Dollar of Exclusion You’re Entitled To.
This guide walks you through how the ownership and use tests work, how to claim a partial exclusion if you sold before 24 months, how to calculate your gain (including on a foreign home), how to report the sale on Form 8949 and Schedule D, and how Section 121 stacks with the Foreign Tax Credit and a 1031 exchange.
What Is the Section 121 Primary Residence Exclusion?
The Section 121 exclusion is a provision of Internal Revenue Code Section 121 that lets a homeowner exclude a portion of the capital gain from the sale of a main home from federal income tax. For 2025 tax returns filed in 2026, the maximum exclusion is $250,000 for single filers and $500,000 for married couples filing a joint return.
The exclusion covers your main home, which the IRS defines as the residence you live in most of the time. The property can be a house, condo, co-op, mobile home, houseboat, or trailer, and it can be located inside the United States or in another country.
A few quick clarifications most homeowners need:
- Only one main home at a time: If you own more than one residence, only the one you live in most of the year qualifies for the exclusion.
- No deductible loss on a personal home: A loss on the sale of a personal-use home is not deductible. The exclusion only matters when there is a gain.
- Investment property does not qualify directly: Vacation homes and rentals do not qualify unless they were converted to a main home and held long enough to meet the use test.
Who Qualifies for the $250,000 or $500,000 Home Sale Exclusion?
You qualify for the full primary residence capital gains exclusion if you meet the ownership test and the use test during the 5-year period ending on the date of sale, and you have not used the exclusion on another home in the past 2 years.
| Filing status | Maximum exclusion | What you must show |
|---|---|---|
| Single | $250,000 | You owned the home for 24 months out of the last 5 years, and lived in it as your principal residence for 24 months out of the last 5 years |
| Married filing jointly | $500,000 | At least one spouse meets the ownership test, both spouses meet the use test, and neither spouse has claimed the exclusion in the last 2 years |
| Married filing separately | $250,000 each | Each spouse measured independently |
| Surviving spouse | $500,000 | Sale occurs within 2 years of the spouse’s death, and all conditions were met before death |
A few important details about the tests:
- The 24 months do not need to be consecutive. Short absences for vacation, work travel, or medical care still count as time you lived in the home.
- Ownership and use windows can overlap or differ. As long as each test is met somewhere inside the 5-year lookback, you qualify.
- The exclusion is available once every 2 years. If you used it on a prior sale within the last 24 months, you are limited unless you qualify for the partial exclusion below.
Quick example
Sarah bought a home in March 2020 and lived in it as her main residence until March 2024, when she accepted a job overseas and rented it out for the next 13 months. She sells in April 2025. The 5-year lookback covers April 2020 through April 2025. Inside that window, Sarah owned the home for 60 months and lived in it for 47 months. She meets both tests and qualifies for the full exclusion, with a small downward adjustment for the rental period (covered in the gain-calculation section below).
ImportantSection 121 follows the homeowner, not the home. A U.S. citizen or green card holder can claim it on a primary residence anywhere in the world, as long as the ownership and use tests are met.
How Does the 2 Out of 5 Year Rule Work?
The “two out of five year rule” is simply how the IRS phrases the ownership and use tests. During the 5 years immediately before the closing date, you must have owned the home for any 24 months and used it as your principal residence for any 24 months. The two periods can be the same months, different months, continuous, or split into chunks.
A few common situations:
- Lived there, moved out, sold within 3 years: You usually still qualify. Time after you moved out, up to 3 years, still leaves you inside the 5-year lookback with 24 months of use.
- Bought a home, rented it for 3 years, then moved in for 2 years before selling: You meet both tests, but the rental period creates “nonqualified use” that limits how much of the gain is excludable (covered below).
- Inherited the home and lived there for 2 years: Your ownership starts on the date of death, and your use test must be met after you take title.
How Do You Prove You Lived in the Home as Your Primary Residence?
If the IRS questions whether a property was truly your main home, the burden of proof is on you. Records that typically establish principal-residence use:
- Address on tax returns: Federal and state returns filed from the address.
- Driver’s license, voter registration, and vehicle registration at the address.
- Utility bills, internet, and mobile phone statements showing usage and address.
- Mailing address for banks, brokerage statements, credit cards, and employer payroll.
- Homeowner’s insurance listing the property as a primary residence.
- School enrollment for children at addresses tied to the home.
- Mortgage interest statements (Form 1098) showing the home as your principal residence.
For a foreign home, keep the local equivalents: residency permits, tax registration in your country of residence, local utility bills, and bank statements that show the address. These records also matter for state tax purposes if you are arguing that you broke residency in a “sticky” state.
What If You Don’t Meet the 24-Month Tests? Partial Section 121 Exclusion
If you have to sell before you hit the 24-month threshold, you may still claim a reduced exclusion if the sale was triggered by one of the IRS-recognized reasons.
Qualifying reasons:
- Change in place of employment: You, your spouse, or a co-owner takes a new job at least 50 miles farther from your old home than your old job was.
- Health: A licensed health-care provider recommends a move to obtain, provide, or facilitate medical care.
- Unforeseen circumstances: Examples include divorce, multiple births from a single pregnancy, death of a spouse, involuntary conversion of the home, a federally declared disaster, or unemployment that qualifies you for unemployment compensation.
The reduced exclusion is calculated by multiplying the maximum exclusion by a fraction: the shorter of (a) the months you met the ownership and use tests or (b) the months since your last claim, divided by 24.
Example: A single filer lives in her home for 12 months, then accepts a new role 90 miles away. Her reduced exclusion is 12 ÷ 24 × $250,000 = $125,000, which is enough to fully shelter most short-term gains.
How Does the Primary Residence Exclusion Work When You Sell a Home Abroad?
The Section 121 exclusion is not a U.S.-only benefit. A U.S. citizen or green card holder can claim it on a primary residence located anywhere in the world, as long as the ownership and use tests are met. Whether your home is in Mexico City, Lisbon, Auckland, or Denver, the federal exclusion is on the table.
A few expat-specific points to keep in mind:
- The Foreign Earned Income Exclusion does not apply to a home sale. The FEIE excludes only earned income (wages and self-employment). Capital gain on a home sale is unearned income and stays outside the FEIE, even if you meet the physical presence test or bona fide residence test.
- The Foreign Tax Credit picks up where Section 121 leaves off. If your gain exceeds the $250,000 or $500,000 limit and the country where the home is located also taxed the sale, you can usually offset the remaining U.S. tax with the Foreign Tax Credit on Form 1116. Our FEIE vs. FTC comparison walks through how to choose between strategies.
- Currency exchange affects the gain. Your gain is calculated in U.S. dollars using the spot exchange rate on both the purchase and sale dates. A favorable currency shift can create a U.S. tax gain even when the local-currency price barely moved. The foreign capital gains guide explains the mechanics.
- State tax can still apply. A few “sticky” states (California, New York, Virginia, South Carolina, New Mexico) may still consider you a resident even after you move abroad. See our state tax for expats guide and our walk-through on changing state residency from abroad.
For a scenario-by-scenario reading, see our guide to selling a house while abroad and our walk-through for a green card holder selling foreign property.
Own Property Abroad? Section 121 Works Worldwide, But the Reporting Is Different.
How Do You Calculate Your Taxable Gain on a Home Sale?
Your gain is the amount realized on the sale minus your adjusted basis in the home. Two adjustments commonly reduce the portion of that gain that the Section 121 exclusion can shelter: depreciation recapture and nonqualified use.
Step 1: Calculate the gross gain
| Component | What it includes |
|---|---|
| Amount realized | Sale price minus selling expenses (real estate commissions, legal and escrow fees, advertising, title charges) |
| Adjusted basis | Original purchase price, plus capital improvements (additions, new roof, kitchen remodel), minus depreciation, casualty losses, and certain credits |
| Realized gain | Amount realized minus adjusted basis |
Step 2: Set aside depreciation recapture
Any depreciation you claimed (or were allowed to claim) on the home for periods after May 6, 1997, is not eligible for the Section 121 exclusion. That portion of your gain is taxed at a maximum federal rate of 25 percent. Depreciation recapture typically applies when you rented the home out or used part of it as a home office.
Step 3: Apply the nonqualified-use rule
Time after January 1, 2009, when the home was not your principal residence (for example, while you rented it out or used it as a second home) is called nonqualified use. The fraction of total ownership months represented by non-qualified use is not eligible for the exclusion. Time after you moved out, if you sell within the 5-year window, generally does not count against you.
Putting it together
Suppose you owned a home for 10 years (120 months). For the first 4 years (48 months), you rented it out and claimed $20,000 of depreciation. You then moved in and used it as your principal residence for the last 6 years (72 months). On the sale, you realized a $300,000 gain.
| Step | Calculation | Result |
|---|---|---|
| Depreciation recapture | $20,000 taxed at up to 25% | Not excludable |
| Remaining gain | $300,000 minus $20,000 | $280,000 |
| Nonqualified-use share | 48 ÷ 120 × $280,000 | $112,000 taxable as capital gain |
| Eligible for exclusion | 72 ÷ 120 × $280,000 | $168,000 excluded (within the $250,000 single-filer cap) |
Keep records of every improvement you make and every closing document on the way in and the way out. For a foreign home, keep both local-currency receipts and the USD-equivalent figures at the relevant exchange rates.
Pro TipDepreciation recapture trips up more home sellers than any other Section 121 issue. If you ever rented out part of your home (even one summer on Airbnb) or claimed a home-office deduction, expect a portion of your gain to fall outside the exclusion and be taxed at up to 25%.
How Do You Report the Home Sale on Your Tax Return?
If your gain is fully excluded under Section 121 and you did not receive a Form 1099-S, you generally do not need to report the sale on your return. Otherwise, you do.
You MUST report the sale if any of the following apply:
- You received a Form 1099-S from the closing agent.
- Part of your gain is taxable (because it exceeds the exclusion, includes depreciation recapture, includes nonqualified-use gain, or you do not fully qualify).
- You want to report a loss on the business-use portion of a home that was partially rented or used as an office (a personal-use loss is not deductible).
The reporting flows through two forms:
- Form 8949, Sales and Other Dispositions of Capital Assets: Lists the property, dates, proceeds, cost basis, and adjustments. Enter code “H” in column (f) and the excluded amount as a negative adjustment in column (g) to claim the Section 121 exclusion.
- Schedule D (Form 1040), Capital Gains and Losses: Pulls totals from Form 8949 and calculates net capital gain or loss for the year.
If the home has a rental or business component, depreciation recapture is reported on Form 4797 first, then carried to Schedule D.
How Do the Foreign Tax Credit, State Tax, and NIIT Affect Any Taxable Portion?
If part of your gain is taxable after the exclusion, three more layers can affect what you end up owing:
- Foreign Tax Credit: If your home was located in a country that taxed the sale (the UK, Australia, Spain, and Canada all tax property sales in different ways), the Foreign Tax Credit can usually offset the U.S. tax on the same gain. The credit is calculated on Form 1116, and any unused passive-category credit can be carried back one year and forward ten.
- State tax: Most states start with federal adjusted gross income and automatically inherit the federal exclusion, but a handful decouple, and a few will still tax the gain if they consider you a resident. Check your state’s rules before you close.
- Net Investment Income Tax: If your modified adjusted gross income exceeds $200,000 single or $250,000 MFJ, the taxable portion of your gain may be subject to the 3.8% Net Investment Income Tax. The Section 121 exclusion reduces the gain before NIIT is applied.
What’s the Difference Between a Section 121 Exclusion and a 1031 Exchange?
Section 121 and Section 1031 are sometimes confused because both relate to real estate, but they serve different purposes.
| Feature | Section 121 (Primary Residence Exclusion) | Section 1031 (Like-Kind Exchange) |
|---|---|---|
| Type of property | Main home (personal residence) | Investment or business-use real estate |
| What it does | Permanently excludes up to $250K / $500K of gain | Defers tax by rolling proceeds into a new like-kind property |
| Holding rules | 24 months ownership and use in the 5 years before sale | Strict 45-day identification and 180-day closing windows |
| Cash in hand? | Yes, you can keep proceeds tax-free up to the cap | No, proceeds must be held by a qualified intermediary |
| Repeats? | Once every 2 years | No frequency limit |
If you converted a rental property into your principal residence and later sell, you may layer both rules: a prior 1031 exchange into the home (with a 5-year holding period) can later allow a Section 121 exclusion on the personal-use portion. This is a common planning move, but the rules around basis carryover and nonqualified use are detailed, and a small misstep can cost the entire exclusion.
Is There a “6-Year Rule” for the Primary Residence Exclusion in the U.S.?
Not under federal U.S. tax law. The “6-year rule” you may have read about is an Australian Tax Office rule, not an IRS rule. The U.S. equivalent is the 5-year lookback combined with the 2 out of 5 year test (Section 121 ownership and use).
What that means in practice: if you move out of your U.S. main home and sell it within roughly 3 years, you generally still qualify for the full exclusion because 2 of the last 5 years still include your time as a resident. Beyond 3 years out of the home, you fail the use test unless you re-establish residence.
Can You Have More Than One Primary Residence?
No. For Section 121 purposes, you can have only one main home at a time. The IRS looks at where you live most of the year, where your immediate family lives, your mailing address, voter registration, driver’s license, and similar factors. A couple who owns two homes can designate the one they live in most of the year as the primary residence, but only that home qualifies for the Section 121 exclusion at any given time.
If you alternate between two homes, both spouses must use the same property as their main home to claim the $500,000 exclusion on a joint return.
What Mistakes Do Homeowners Make With the Section 121 Exclusion?
The home sale exclusion is straightforward when both tests are clearly met, but a few recurring mistakes cost homeowners money or trigger IRS notices.
- Not tracking the 24-month tests carefully. Saving emails, lease agreements, and utility bills that show when you lived in the home pays off if the IRS questions your eligibility.
- Forgetting depreciation recapture. If you ever claimed (or could have claimed) depreciation on a home office or a period of rental use after May 1997, that piece of your gain is not eligible for exclusion.
- Missing the non-qualified-use rule. Periods of rental or second-home use after 2008 reduce the excludable portion of your gain proportionally.
- Ignoring Form 1099-S. If the closing agent issued a 1099-S, you must report the sale even if no tax is owed.
- Selling a foreign home without tracking the USD basis. Buying in pesos, euros, or pounds and selling in those same currencies can still yield a USD gain due to exchange-rate movements. You need both currency figures for the IRS.
- Skipping the Foreign Tax Credit on a taxable foreign sale. Any U.S. tax on the portion above the exclusion can usually be offset by the FTC. Leaving it off the return overstates your bill.
- Assuming state tax follows the federal rule. State conformity varies, and “sticky” states may still claim you.
- Confusing Section 121 with a 1031 exchange. They serve different purposes and have different rules. Mixing them up can cost the exclusion entirely.
When to Bring in an Expat Tax Professional
For most homeowners, claiming the Section 121 exclusion is straightforward. It gets more involved when any of the following are true: you sold a home located outside the U.S., you rented the home out for any period after 2008, you claimed depreciation, you sold before hitting the 24-month threshold, you have a state filing obligation, or your gain is large enough to push you into the Net Investment Income Tax.
In any of those situations, working with a tax professional who knows expat returns can help you stack the exclusion, the Foreign Tax Credit, and your state position correctly, so you only pay what you owe.
Get Your Home Sale Reported Right the First Time
Frequently Asked Questions
Section 121 of the Internal Revenue Code lets you exclude up to $250,000 of gain ($500,000 for married couples filing jointly) when you sell your main home, as long as you owned and lived in the home as your principal residence for at least 2 of the 5 years before the sale.
Yes. The Section 121 exclusion applies to a U.S. citizen or green card holder’s main home, wherever it is located, including a residence in another country. You still need to meet the 24-month ownership and use tests during the 5 years before the sale.
The IRS looks at where you spent most of the year, plus supporting evidence like driver’s license, voter registration, federal and state tax returns filed from the address, utility bills, homeowner’s insurance, mailing address on bank and brokerage statements, employer payroll records, and (where relevant) children’s school enrollment.
Yes, but generally not more often than once every two years. You must wait at least 24 months between sales that claim the full exclusion, unless you qualify for a partial exclusion under the job-change, health, or unforeseen-circumstances rules.
Not always. If your gain is fully excluded and you did not receive a Form 1099-S, you generally do not need to report the sale. If you received a Form 1099-S, you must report the sale on Form 8949 and Schedule D, even if no tax is owed.
A married couple filing jointly qualifies for the $500,000 exclusion only if at least one spouse meets the ownership test, both spouses meet the use test, and neither spouse has claimed the exclusion on another home in the last 2 years. If only one spouse used the home as a principal residence, the couple is generally limited to the $250,000 exclusion attributable to that spouse.
Any depreciation you claimed (or could have claimed) for periods after May 6, 1997, is not eligible for the exclusion. That portion of the gain is taxed at a maximum federal rate of 25 percent, separate from any ordinary capital gains tax on amounts above the exclusion.
Not directly. The exclusion is only available for your main home. If you convert a former rental into your principal residence and live there for at least 24 months, you may qualify for a partial exclusion, reduced by the nonqualified-use period.
The closing disclosure from purchase and sale, receipts for capital improvements, depreciation schedules if the home was ever rented, and (for a foreign home) the exchange rates on the purchase and sale dates. Keep these records for as long as you own the home, and for at least 3 years after the sale.
This article is for general informational purposes only and does not constitute tax, legal, or accounting advice. Federal tax rules, exclusion amounts, and reporting requirements change. Verify the current rules with the IRS or speak with a qualified tax professional before relying on this information for a specific transaction.
Related Resources
- Foreign Capital Gains Tax for U.S. Expats: Rules, Rates, and Strategies
- U.S. Taxes on Foreign Property: A Guide to Buying and Selling Real Estate Abroad
- Form 8949 for U.S. Expats: Reporting Capital Gains and Losses
- Schedule D for U.S. Expats: Reporting Capital Gains and Losses
- Foreign Tax Credit Guide: How to Reduce U.S. Expat Taxes
- Form 1116 Instructions: Claim the Foreign Tax Credit
- Do Expats Pay State Taxes? A Guide for Americans Living Abroad
- Selling Your House While Living Abroad
- Green Card Holder Selling Foreign Property: Your Tax Questions Answered
- U.S. Expat Taxes: The 2026 Guide for Americans Living Abroad