The Section 121 exclusion lets you keep up to $250,000 of profit from selling your main home free of federal income tax, or up to $500,000 if you’re married and file jointly. To qualify, you have to have owned the home and lived in it as your principal residence for at least two years out of the five years ending on the sale date. The rule sounds simple, but rental periods, depreciation, prior exclusions, and 1031 exchanges each change what you actually get to exclude.
The Ownership and Use Tests
Two tests decide whether you qualify. During the five-year period ending on the date you sell, you must have owned the home for at least 24 months and lived in it as your principal residence for at least 24 months.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Neither period needs to be continuous, and the two periods don’t need to overlap. Someone who rents a home for two years and then buys it and lives in it for two more years satisfies both tests independently. Someone who lives in a home during years one and three of a five-year ownership period, and rents it out the rest of the time, also qualifies.2eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence
If you own more than one home, only the one that qualifies as your principal residence is eligible. The IRS looks at where you actually spend most of your time, plus which address you use for tax returns, voter registration, driver’s license, car registration, and mail, along with proximity to work and family.3Internal Revenue Service. Topic No. 701, Sale of Your Home A long pattern of using one address for all of these is a stronger claim than a switch made shortly before selling.
How Much You Can Exclude
The cap is $250,000 for single filers, heads of household, and married individuals filing separately. Joint filers can exclude up to $500,000.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
To claim the full $500,000, at least one spouse must meet the ownership test, both spouses must independently meet the use test, and neither spouse can have used the exclusion within the prior two years. A married couple with a $400,000 gain who meets those conditions owes no federal capital gains tax on the sale. A single filer with a $200,000 gain likewise pays nothing. You don’t need to buy a replacement home or reinvest the proceeds; the exclusion simply erases gain up to the cap.
The Two-Year Frequency Limit
You can only use the exclusion once every two years. If you excluded gain on a different home sale within the two years ending on the date of your current sale, the exclusion is unavailable for the current sale.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Someone who excluded gain in March 2024 can’t use the exclusion again until after March 2026. Selling before that means the full gain is taxable, even if the ownership and use tests are satisfied on the new property. A prorated exclusion may still be available if the second sale was driven by one of the qualifying reasons below.
Partial Exclusion When You Sell Early
If you sell before meeting the two-year ownership or use requirement, you can still claim a reduced exclusion when the sale is caused by a change in employment, a health-related need, or an unforeseen circumstance.4eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements
The IRS provides safe harbors for each category. An employment change qualifies if the new workplace is at least 50 miles farther from your home than the old one was. A health-related sale qualifies when a physician recommends the move for medical reasons. Recognized unforeseen circumstances include involuntary conversion of the home, natural disasters or acts of war, death of a resident or co-owner, job loss that qualifies you for unemployment, financial hardship from a change in employment or self-employment that leaves you unable to cover housing and basic living expenses, divorce or legal separation, and multiple births from a single pregnancy.
The reduced exclusion equals the maximum exclusion multiplied by a fraction. The numerator is the shorter of the time you owned or used the home during the five-year window, expressed in months (or days). The denominator is 24 months.4eCFR. 26 CFR 1.121-3 – Reduced Maximum Exclusion for Taxpayers Failing to Meet Certain Requirements
Say you’re a single filer who bought a home and lived in it for nine months before being transferred to a job 200 miles away. The fraction is 9/24. Multiplied by $250,000, that’s a prorated exclusion of $93,750. On a $120,000 gain, you’d exclude $93,750 and owe capital gains tax on the remaining $26,250.
The same proration also helps when you’ve used the full exclusion within the past two years but sell again for a qualifying reason. The time elapsed since the prior sale becomes the numerator.
Calculating Your Gain
Your taxable gain is what you net from the sale minus your adjusted basis. Basis is not just the purchase price.5Internal Revenue Service. Publication 523, Selling Your Home
Start with what you paid, including closing costs like title insurance and recording fees. Add the cost of capital improvements: a new roof, a kitchen remodel, an added bathroom, central air, a deck, a fence. Ordinary repairs like patching drywall or fixing a faucet don’t count.
Then subtract from basis:
- Depreciation you claimed, or were entitled to claim, for business or rental use of the home after May 6, 1997.
- Casualty loss deductions taken for damage from fires, floods, or storms.
- Insurance reimbursements received for casualty losses.
- Certain residential energy credits or subsidies that repaid you for improvements already in basis.
- Mortgage points the seller paid on your behalf when you bought the home, in most cases.
Example: you paid $300,000 for the home, spent $50,000 on a kitchen remodel and windows, and claimed $15,000 in depreciation while renting out part of the house. Adjusted basis is $335,000. Selling for $600,000 with $35,000 in selling costs leaves an amount realized of $565,000 and a gain of $230,000.
Rental and Investment Use: The Non-Qualified Use Rule
Time you used the home for something other than your principal residence after 2008, whether as a rental, a vacation home, or an investment, is called non-qualified use, and the gain allocable to that time cannot be excluded.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
The taxable portion is a ratio: months of non-qualified use divided by total months of ownership, applied to the total gain. That amount is taxable regardless of whether the $250,000 or $500,000 cap would otherwise cover it. Only the remaining gain is eligible for exclusion.
Three exceptions narrow what counts as non-qualified use:
- Any portion of the five-year window that falls after the last day you used the home as your principal residence is not non-qualified use. You can move out, rent for up to three years, and sell without that rental time counting against you, as long as you still meet the two-year use test within the five-year window.5Internal Revenue Service. Publication 523, Selling Your Home
- Up to 10 years of qualified official extended duty by military or government personnel is excluded from non-qualified use.
- Up to two years of temporary absence for employment, health, or unforeseen circumstances does not count.
Rental First, Then Move In
A single filer buys a property on January 1, 2018, rents it for 48 months, then moves in on January 1, 2022. After two years of residence, they sell on January 1, 2024 with a $350,000 gain. Total ownership is 72 months. The 48-month rental period is non-qualified use. The ratio 48/72 makes $233,333 immediately taxable. The remaining $116,667 falls below the $250,000 cap and is excluded. Taxable gain: $233,333.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Live In, Then Rent, Then Sell
A single filer buys on January 1, 2019, lives there three years, moves out on January 1, 2022, and rents until selling on January 1, 2024. Ownership is 60 months, gain is $200,000. Because the two-year rental period falls after the last day of principal residence use, it is not non-qualified use. The seller meets both tests. The full $200,000 gain is excluded. This is one of the more valuable planning windows in Section 121.
Depreciation Recapture
The exclusion does not cover gain equal to depreciation claimed or claimable after May 6, 1997. That depreciation is recaptured and taxed even when the rest of the gain is fully excluded.5Internal Revenue Service. Publication 523, Selling Your Home
Recaptured depreciation is taxed as unrecaptured Section 1250 gain at a maximum rate of 25%, higher than ordinary long-term capital gains rates.6Internal Revenue Service. Topic No. 409, Capital Gains and Losses Say you rented the home for five years and claimed $40,000 in depreciation, then moved in for two years and sold with a $200,000 gain. The $40,000 is taxable at up to 25%. The remaining $160,000 qualifies for the exclusion. Sellers who forget about recapture often plan for zero tax and end up owing.
Homes Acquired Through a 1031 Exchange
If you got the home as replacement property in a Section 1031 like-kind exchange, you must own it for at least five years before any Section 121 exclusion is available on its sale.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
This five-year hold runs from the acquisition date and sits on top of the standard two-year use test. Complete a 1031 exchange in 2021, convert the property to your principal residence in 2022, meet the two-year use test by 2024, and you still can’t use the exclusion until 2026. The non-qualified use rules also apply to any pre-move-in rental or investment period.
Divorce, Death, and Military Service
Section 121 adjusts for several life events so unavoidable changes don’t cost the exclusion.
Divorce or Separation
If the home was transferred to you from a spouse or former spouse under Section 1041, you can count their ownership time toward your own ownership test. You’re also treated as using the home as your principal residence during any period your former spouse lives there under a divorce or separation agreement.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
The spouse who moved out can still qualify when the home eventually sells. Bought together in 2018, one spouse moves out under a decree in 2022, home sells in 2024: the spouse who left still meets both tests because the other spouse’s continued residence counts.
Death of a Spouse
A surviving spouse who sells within two years of the date of death can claim the full $500,000 exclusion, if the couple met the joint-return requirements immediately before the death. The survivor also inherits the deceased spouse’s ownership and use periods.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
After that two-year window, the survivor files as single and the exclusion drops to $250,000. The survivor also typically receives a stepped-up basis on the deceased spouse’s share of the property, which can further reduce taxable gain.
Military and Government Service
Members of the uniformed services, the Foreign Service, and intelligence community employees can elect to suspend the five-year test period while serving on qualified official extended duty, meaning ordered to a duty station at least 50 miles from the home, or living in government quarters under orders, for more than 90 days.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Suspension can extend the five-year lookback by up to 10 years, creating a potential 15-year window in which to satisfy the two-year requirements. A service member who lived in a home for two years, deployed for a decade, and then sold could still qualify because the clock was paused throughout the deployment.
When You Have to Report the Sale
Not every home sale has to appear on your tax return. If you meet the ownership and use tests, the gain is fully excluded, and you did not receive a Form 1099-S from the closing agent, no reporting is required.5Internal Revenue Service. Publication 523, Selling Your Home
You must report the sale if you have taxable gain that exceeds or doesn’t qualify for the exclusion, if you received a Form 1099-S (in which case the sale goes on Form 8949 and Schedule D even if the gain is fully excludable so IRS records match), or if you choose to report taxable gain rather than exclude it.
At closing, the settlement agent will usually ask you to sign a certification that you qualify for the exclusion. If you sign, the agent is not required to issue a 1099-S. If you don’t sign, or the certification isn’t completed by January 31 of the following year, the agent must file the form with the IRS, and a return that omits the sale will draw a notice.
Non-excluded gain on a home held longer than a year is taxed at long-term capital gains rates, and higher-income sellers may also owe the 3.8% Net Investment Income Tax on top. Different portions of the same sale can sit in different rate buckets: ordinary long-term gain, depreciation recapture at up to 25%, and any short-term slice at ordinary rates. Work through each piece separately before you assume the check to the IRS is zero.