Capital Gains Exclusion If Your Home Was Used as a Rental

You can claim the capital gains exclusion on the sale of a rental home if it was also your primary residence for at least two of the last five years, but any years you rented the property before moving in reduce the exclusion, and depreciation you claimed during the rental years is taxed separately at up to 25%. The full exclusion is $250,000 of gain for single filers and $500,000 for married couples filing jointly.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Whether the rental happened before or after you lived there is the single biggest factor in how much tax you owe.

The Two-Year Ownership and Use Tests

To claim any part of the exclusion, you need to clear two tests during the five-year period ending on the sale date. You must have owned the home for at least two of those five years, and you must have lived in it as your primary residence for at least two of those five years.2Internal Revenue Service. Publication 523 – Selling Your Home The 24 months of residence don’t have to be consecutive.

For a married couple filing jointly, only one spouse needs to satisfy the ownership test, but both must independently meet the use test to claim the full $500,000. If only one spouse qualifies, the couple is capped at $250,000. You also cannot use the exclusion more than once every two years.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

Why the Order of Rental and Residence Matters

Passing the use test doesn’t automatically give you the full exclusion. If part of your ownership was spent renting the home rather than living in it, the IRS may treat that time as “nonqualified use.” The label applies to any period after December 31, 2008, during which the home was not your principal residence.3Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Rental periods before January 1, 2009, are grandfathered and don’t affect the exclusion at all.

Any gain allocated to nonqualified use cannot be excluded, even if you otherwise pass the ownership and use tests. The IRS allocates by dividing nonqualified-use days by total ownership days and applying that fraction to your gain.3Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

The critical point: rental periods that fall after your last day of residence are not counted as nonqualified use. Live in a home for three years and then rent it out for two before selling, and the full exclusion is still available, because those rental years came after your residence ended.2Internal Revenue Service. Publication 523 – Selling Your Home Reverse the order — rent for two years, then live there for three — and those two rental years reduce the exclusion. Same property, same timeline, very different tax bill.

Rental Periods That Don’t Count Against You

Section 121 carves out three periods that are ignored in the nonqualified use calculation:1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

  • Any rental period that falls after the last day you used the home as your primary residence.
  • Up to 10 years of absence while serving on qualified official extended duty in the military, intelligence community, or Peace Corps.
  • Up to two years of absence due to a job change, health condition, or unforeseen circumstances such as divorce or a natural disaster.

Calculating the Reduced Exclusion

When rental time before your residence does count as nonqualified use, Publication 523’s Worksheet 3 lays out a day-counting method.2Internal Revenue Service. Publication 523 – Selling Your Home Count the days after 2008 when neither you nor your spouse used the home as a primary residence, excluding any that fall after your last day of residence. Divide that by the total days you owned the property. Multiply your total capital gain by that fraction. The result is the portion of gain that cannot be excluded.

A worked example: a single homeowner buys a property on January 1, 2016, rents it out for four years, moves in on January 1, 2020, and sells on January 1, 2026, with a total gain of $200,000. The four rental years happened before residence, so they count as nonqualified use. The fraction is roughly 4/10, or 40%. That makes $80,000 of the gain taxable and leaves $120,000 eligible for the exclusion.

Depreciation Recapture Is a Separate Tax

Even when your entire gain fits inside the exclusion, depreciation triggers its own bill. The exclusion does not cover any gain attributable to depreciation taken after May 6, 1997.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence That amount is recaptured as unrecaptured Section 1250 gain, taxed at a maximum federal rate of 25%.4Internal Revenue Service. Topic No. 409 – Capital Gains and Losses

The IRS applies an “allowed or allowable” standard. Even if you never actually claimed depreciation during rental years, the IRS assumes you did and requires recapture on the amount you were entitled to take.5Internal Revenue Service. Depreciation Recapture 3 Skipping the deduction on prior returns doesn’t help you at sale. If you rented the property and never claimed depreciation, ask a tax professional whether amended returns are worth filing.

How this plays out: a homeowner has a $300,000 gain that fully qualifies for the exclusion under Section 121, but claimed $40,000 of depreciation during a prior rental period. The exclusion covers only $260,000. The $40,000 of recaptured depreciation is taxed at up to 25%, generating up to $10,000 in tax even though the rest of the gain is tax-free.

Tax Rates on the Portion You Cannot Exclude

Any gain outside the exclusion — from nonqualified use, from exceeding the $250,000 or $500,000 cap, or both — is taxed at long-term capital gains rates if you owned the property for more than a year. For 2026, single filers pay 0% on gains up to $49,450 of taxable income, 15% between $49,450 and $545,500, and 20% above that. For married couples filing jointly, the 15% bracket starts at $98,900 and the 20% bracket at $613,700.

Higher earners face the 3.8% Net Investment Income Tax on top of that. The NIIT applies to modified adjusted gross income above $200,000 for single filers, $250,000 for married filing jointly, and $125,000 for married filing separately.6Internal Revenue Service. Topic No. 559 – Net Investment Income Tax Capital gains count as investment income, so a taxable portion of your home sale can push a chunk of your gain into the surtax.

Partial Exclusion If You Sell Before Two Years

Selling before you hit the two-year residency mark can still produce a reduced exclusion when the sale was driven by a job change, a health issue, or unforeseen circumstances.2Internal Revenue Service. Publication 523 – Selling Your Home The partial amount is a fraction of the full $250,000 or $500,000, based on how much of the two years you completed.

For work moves, the new job location must be at least 50 miles farther from the home than your previous workplace was.2Internal Revenue Service. Publication 523 – Selling Your Home Health-related sales qualify when a doctor recommends a move or the move is necessary for diagnosis, treatment, or recovery. Unforeseen circumstances include natural disasters, divorce, job loss, death, and involuntary conversion of the property. A homeowner who lived in a property for 15 months before relocating for work, for instance, could claim 15/24 of the $250,000 exclusion, or roughly $156,250.

If You Acquired the Home Through a 1031 Exchange

Homes obtained through a like-kind exchange under Section 1031 come with a stricter rule. You cannot claim the Section 121 exclusion at all during the first five years after acquiring the replacement property, regardless of when you move in.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence After that, the normal ownership and use tests still apply, and any depreciation deferred in the original exchange follows the property. It gets recaptured when you eventually sell.

Reporting the Sale

Expect several forms beyond your standard return. The closing agent will usually issue a Form 1099-S reporting the sale proceeds. An exception exists when the price is $250,000 or less ($500,000 for married filers) and the seller certifies the full gain is excludable.7Internal Revenue Service. Instructions for Form 1099-S (Rev. December 2026) If any part of your gain is taxable, you won’t qualify for that exception.

Capital gains from the sale go on Form 8949 and flow to Schedule D of your Form 1040.8Internal Revenue Service. Instructions for Form 8949 Depreciation recapture on property used for rental purposes is reported on Form 4797, Part III, which separates the ordinary-income portion from the capital gain.9Internal Revenue Service. Instructions for Form 4797 Getting the split wrong between excluded gain, taxable capital gain, and recaptured depreciation is one of the most common errors on mixed-use home sales, and it tends to surface as an IRS notice a year later. A tax professional who works on these regularly is worth the fee.