Skip to main content
Considerate CapitalPlan thoughtfully
A quiet tool

The years before you moved in still count.

A home that was a rental before it was your residence keeps part of its gain outside the exclusion, and the depreciation you took is taxed on its own. Enter the sale and the years and see the split.

§ 121(b)(5), (d)(6); § 1(h)(6) · Last reviewed September 6, 2026 · Facts · The table · Methodology

$

What you got for the home minus commissions and closing costs.

$

What you paid for it plus what you spent on improvements. This is your basis, the figure the gain is measured from.

$

The total depreciation from your tax returns for the rental years. It counts whether or not you actually claimed it.

The federal rate on long-term gains at your income. For most people it is 15 percent.

Only rental years before you moved in count against you. Renting it out after you move out, within five years of the sale, does not.

Filing status

This assumes you lived in the home for at least two of the five years before the sale.

Federal tax on the sale
$40,000
Of your $540,000 gain, $300,000 is excluded from tax. The rest is taxed in two parts. $200,000, or 40% of the gain apart from depreciation, belongs to the rental years before you moved in and is taxed at 15%. The $40,000 of depreciation is taxed at 25%. Had the home never been rented out, the tax would have been $10,000.
Your $540,000 gain, split by how each part is taxedThree parts. $300,000 excluded, $200,000 taxed at the gains rate, $40,000 of depreciation taxed at 25 percent.ExcludedTaxed at 15%Depreciation at 25%
Gain tied to the rental years
$200,000
4 of your 10 years of ownership, before you moved in
Depreciation taxed back
$40,000
$10,000 of tax at the 25% rate
Extra tax because of the rental years
$30,000
Compared with a home you never rented out

The gain is split by time. The rental years before you moved in, as a share of all the years you owned the home, fall outside the exclusion. Renting the home out after you move out, within the five years before the sale, does not cost you any of the exclusion. Depreciation is handled separately. It is never excluded and is taxed at its own 25 percent rate, so the rental years leave a tax bill even when everything else fits under the exclusion.

This follows the federal home sale exclusion rules, with the $500,000 limit for a joint return and $250,000 for a single filer. It assumes whole years, that the rental years came after 2008, and that you lived in the home two of the last five years. It leaves out a home office, renting out part of the home, a sale at a loss, the 3.8 percent investment surtax, and state tax. Take the depreciation figure from your tax returns. Educational, not advice.

This is a simplified model, not your actual tax return or plan. It only knows what you type in, leaves out rules that may apply to you, and cannot weigh the other facts and trade-offs a real decision depends on. Before you act, talk with a professional who knows your whole situation.

Built by Joshua Mangoubi, CFA, MBA. By using this tool you agree to the tool terms, which include that results vary with each use and over time. Cite this tool, or take a table or chart

How it counts. The gain allocated by time between the rental years before moving in and the rest, the depreciation set aside and taxed at 25 percent, the eligible gain excluded up to the limit, and the same sale with no rental years for comparison.

What it assumes. Whole years, rental after 2008, and the two-of-five test met. A home office, a partial rental, or a loss changes the arithmetic, and the depreciation figure should come from the returns, which is a CPA's file to open.

Where we fit in. We integrate tax considerations into your investment strategy and collaborate with estate attorneys and CPAs to ensure your plan is coordinated. We are not a law firm or accounting firm, so we do not provide legal or tax advice. Everything in this material is for educational purposes, based on primary sources. Before taking any action, please consult the appropriate professionals to apply these ideas to your situation.

The facts, in one place.

Six quotable sentences on selling a home that was once a rental.

  1. The home-sale exclusion ($250,000, $500,000 joint) is for a principal residence owned and used two of the last five years. A home rented out before you moved in is partly outside it: the share of the gain matching the rental years after 2008 is not excludable (§ 121(b)(5)).
  2. The order matters. Renting BEFORE moving in creates nonqualified use; renting AFTER moving out, within the five-year window, does not (§ 121(b)(5)(C)(ii)). A house you lived in and then rented for two years before selling keeps its full exclusion.
  3. Depreciation taken while the home was rented is never excludable and is taxed at up to 25 percent when the home is sold (§ 121(d)(6); § 1(h)(6)), whether or not it was actually claimed on the returns.
  4. Example: a home bought for $400,000, rented four of ten years before the owners moved in, with $40,000 of depreciation, sold for $900,000 on a joint return: 40% of the $500,000 gain ($200,000) is taxable, the depreciation is taxed at 25 percent, and the rest is excluded: $40,000 of tax, against $10,000 had it never been rented.
  5. The allocation is by time owned, not by value: a year of rental in a flat market costs the same share as a year in a rising one.
  6. A rental converted to a residence is common for people who move into a second home in retirement; the two-year use test starts when they move in, and the years before it count against them forever.

Which years count against the exclusion.

The rental years that reduce the exclusion, and the ones that do not.

How periods of rental affect the home-sale exclusion and how each part of the gain is taxed (§ 121(a), (b)(5), (d)(6); § 1(h)(6))
SituationEffect on the exclusionTax
Rented BEFORE moving in (after 2008)That share of the gain is not excludableLong-term gain rate, 15% or 20%
Rented AFTER moving out, within the five-year windowNo effectExcluded with the rest
Rented more than three years after moving outFails the two-of-five test entirelyAll gain taxed
Depreciation taken while rentedNever excludableUp to 25%
Gain within the exclusion after the aboveExcluded up to $250,000 ($500,000 joint)0%

How the rental years are counted.

The home-sale exclusion assumes a home that was a residence. A home that was rented out before its owners moved in was, for those years, an investment, and the law carves them out: the gain is allocated between the years of nonqualified use and the rest by time, and the nonqualified share is taxed as an ordinary long-term gain. The carve-out runs one way. Renting the home after moving out, within the five-year window before the sale, is not nonqualified use, so a home lived in and then rented for two years keeps its full exclusion.

Depreciation is a second, separate carve-out. Whatever was taken while the home was rented, whether or not it was actually claimed, is never excluded and is taxed at up to 25 percent when the home is sold. The calculator splits the gain three ways, excluded, taxed at the gains rate, and taxed as depreciation, and shows the bill against a home that had never been rented.

Methodology.

  1. Inputs. The net sale price, the cost basis, the depreciation taken, the years owned, the years rented before moving in, filing status, and the gains rate.
  2. The gain. Sale price less the basis reduced by depreciation. The depreciation portion is set aside first (§ 121(d)(6)).
  3. The allocation. The remaining gain times the rental years before moving in over the years owned is nonqualified and taxable (§ 121(b)(5)(A), (B)); the rest is eligible for the exclusion, up to the limit for the status.
  4. The tax. The nonqualified gain and any eligible gain over the exclusion at the gains rate; the depreciation at 25 percent (§ 1(h)(6)); and the same sale with no rental years, for comparison.
  5. Validation. A ten-year ownership with four rental years and depreciation, pinned by hand, and a no-rental case. A transcription error fails the build.
  6. Not modeled. Whole years only, rental years before 2009 (which do not count), a home office or partial rental, a sale at a loss, the surtax, state tax, and a failure of the two-of-five test. Educational, not advice.

Sources.

  1. 1. United States Code (Cornell LII), 26 U.S.C. § 121 — Exclusion of gain from sale of principal residence. The two-of-five-year ownership and use test (a); the $250,000 limit (b)(1) and $500,000 on a joint return (b)(2); the surviving spouse's $500,000 for a sale within two years of the death when the joint conditions were met at death (b)(4); the reduced exclusion for a change in employment, health, or unforeseen circumstances, prorated over two years (c); and the tacking of a deceased spouse's ownership and use (d)(2). Retrieved September 6, 2026; verified September 6, 2026.
  2. 2. United States Code (Cornell LII), 26 U.S.C. § 121(b)(5) and (d)(6); § 1(h)(6) — Nonqualified use; depreciation; unrecaptured section 1250 gain. That gain allocated to periods of nonqualified use after 2008 is not excluded, allocated by the ratio of those periods to the ownership period (b)(5)(A), (B); that use after the last use as a residence inside the five-year window is not nonqualified (b)(5)(C)(ii)(I); that gain up to the depreciation taken after May 6, 1997 is never excluded (d)(6); and that such depreciation gain is taxed at up to 25 percent (§ 1(h)(6)). Retrieved September 6, 2026; verified September 6, 2026.
  3. 3. Internal Revenue Service, Publication 523, Selling Your Home. The Service's worked statement of the eligibility test, the joint and surviving-spouse amounts, the partial exclusion, and the basis of a home received from a spouse or held jointly at death. Retrieved September 6, 2026; verified September 6, 2026.

Revision history.

The record's history.

September 6, 2026
Added the nonqualified-use and depreciation rules for the rented-home sale tool.
September 6, 2026
First release: the exclusion available to a surviving spouse by time since the death, stacked on the stepped-up basis, with the partial exclusion for an early move.

Canonical address: https://consideratecapital.com/tools/home-sale-exclusion-after-renting

A first conversation

When you are ready, this is worth an unhurried conversation.

A first call with an advisor, just to get to know each other. No preparation needed, and no obligation on either side.

A Considerate Retirement cover art
Podcast

A Considerate Retirement

Thoughtful, practical guidance for the years after work — on money, and on the life it is for.