Section 121 Exclusion: The Primary Residence Capital Gains Rule on Home Sales

Section 121 Exclusion: The Primary Residence Capital Gains Rule on Home Sales

The Section 121 exclusion takes up to $250,000 of capital gain on the sale of your main home out of federal income tax, or up to $500,000 if you file jointly. It is also called the primary residence exclusion or the home sale exclusion, and it covers a main home anywhere in the world.

You qualify for the full exclusion when all four of these are true:

  1. Ownership: You owned the home for at least 24 months during the 5 years before the sale.
  2. Use: You lived in it as your principal residence for at least 24 months within that same 5-year window, which is the 2-out-of-5-year rule.
  3. Frequency: You have not claimed the exclusion on another home sold in the last 2 years.
  4. Acquisition: The home was not acquired through a 1031 exchange within the last 5 years.

Whether any tax is left after the exclusion depends on the size of your gain, any period the home was rented, and any depreciation you claimed. This guide covers how the two tests work, how to claim a partial exclusion if you sold before 24 months, how to calculate the gain on a U.S. or foreign home, how to report the sale on Form 8949 and Schedule D, and how Section 121 stacks with a 1031 exchange and the Foreign Tax Credit.

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. The IRS sets out the rules in Publication 523, and Topic 701 carries the short version.

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.

Selling Your Home? Make Sure You Claim Every Dollar of Exclusion You’re Entitled To.

Greenback helps homeowners calculate their Section 121 exclusion, depreciation recapture, and any taxable gain correctly.

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 statusMaximum exclusionWhat you must show
Single$250,000You 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,000At 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 eachEach spouse measured independently
Surviving spouse$500,000Sale 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 at some point within 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. The 13 months of rental do not reduce it, because a period after the last date you used the home as your main home is not a non-qualified use. Any depreciation she claimed during those 13 months is still subject to recapture.

Important

Section 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.

What Do the 5 Years Before a Home Sale Need to Look Like?

The 2-out-of-5-year rule is 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. Those two periods can be the same months, different months, continuous, or split into chunks.

The window always ends on the day you sell and runs 60 months back from that date. What changes from one seller to the next is where the months of principal-residence use sit inside it.

Three 5-year timelines showing Section 121 outcomes for sellers who all owned the home for the full window. A seller who lived in the home for 47 of the last 60 months excludes the full $250,000. A seller who rented for two years before moving in excludes $180,000 and pays tax on $120,000. A seller who rented for the whole window excludes nothing.
  1. A seller who lived in the home for 47 of those 60 months and rented it for the last 13 keeps the full exclusion. Rental income that occurs after you move out is not nonqualified use, so it doesn’t reduce what you can exclude.
  2. A seller who rented the home for the first 2 years, moved in for 2 years, then moved out and sold a year later is in a different position. That rental came before the use, so 2 of the 5 years count as non-qualified use, which proportionally reduces the excludable share of the gain. A $300,000 gain after depreciation leaves $180,000 excluded and $120,000 taxable.
  3. A seller who moved out more than 3 years before selling has no qualifying months left inside the window at all. The exclusion is gone unless a job change, a health reason, or an unforeseen circumstance supports a partial claim, which the next section covers.

Inheriting the home works differently again. Your ownership clock starts on the date of death, and your use test has to 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 applies.

A few expat-specific points to keep in mind:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Greenback helps you claim the exclusion on a foreign home and coordinate it with Form 1116 and local taxes. See how we support foreign property owners.

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

ComponentWhat it includes
Amount realizedSale price minus selling expenses (real estate commissions, legal and escrow fees, advertising, title charges)
Adjusted basisOriginal purchase price, plus capital improvements (additions, new roof, kitchen remodel), minus depreciation, casualty losses, and certain credits
Realized gainAmount 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.

StepCalculationResult
Depreciation recapture$20,000 taxed at up to 25%Not excludable
Remaining gain$300,000 minus $20,000$280,000
Nonqualified-use share48 ÷ 120 × $280,000$112,000 taxable as capital gain
Eligible for exclusion72 ÷ 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 Tip

Depreciation 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.

FeatureSection 121 (Primary Residence Exclusion)Section 1031 (Like-Kind Exchange)
Type of propertyMain home (personal residence)Investment or business-use real estate
What it doesPermanently excludes up to $250K / $500K of gainDefers tax by rolling proceeds into a new like-kind property
Holding rules24 months ownership and use in the 5 years before saleStrict 45-day identification and 180-day closing windows
Cash in hand?Yes, you can keep proceeds tax-free up to the capNo, proceeds must be held by a qualified intermediary
Repeats?Once every 2 yearsNo frequency limit

Can You Use Section 121 and a 1031 Exchange on the Same Property?

Yes, in one direction, and the order decides whether it works. A main home cannot itself be exchanged under Section 1031, because the property has to be held for investment or for business use. What can happen is that a home becomes investment property first, and the sale then qualifies under both provisions. IRS Publication 523 points to Revenue Procedure 2005-14 for how the two are applied to a single sale.

  • The order that works: You live in the home as your main residence for at least 24 months, then move out, convert it to a rental, and sell it while you are still within the 5-year window. The exclusion survives because the months you lived there are still within the lookback period, and the rental months after you moved out are not non-qualified use. Because the property is investment property by the time you sell, the gain above the exclusion can be rolled into a like-kind exchange and deferred.
  • The order that does not: Buying an investment property, renting it out, and then moving in runs into two walls. The rental months before you moved in are non-qualified use, so they reduce the excludable share of the gain. And if the property came to you through a 1031 exchange, Publication 523 is explicit: you cannot claim the exclusion if you sold the home within 5 years of the date it was acquired in that exchange.

Depreciation survives both routes. Any depreciation claimed for periods after May 6, 1997, falls outside the exclusion, is recaptured at up to 25%, and is excluded from the nonqualified-use calculation entirely.

This is the most involved planning move on this page; the timing is unforgiving, and the cost of getting the order wrong is the whole exclusion. Take it to an accountant before you act on it.

What Mistakes Do Homeowners Make With the Section 121 Exclusion?

The home sale exclusion is simple enough when both tests are clearly met, and a few recurring mistakes still 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.

Frequently Asked Questions

Can I use the exclusion more than once?

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.

Do I have to report the sale if my entire gain is excluded?

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.

What if I owned the home with my spouse, but only one of us lived there?

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.

Does the exclusion apply to vacation homes or rental properties?

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.

What records should I keep to claim the primary residence exclusion?

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.

When to Bring in an Expat Tax Professional

Claiming the Section 121 exclusion is simple enough on a home you owned and lived in throughout. 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

Greenback helps you file accurately with flat-fee pricing, direct accountant access, and no costly errors on Form 8949.

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.