The short answer
Roughly three years from the day you move out, assuming you lived there at least two years before leaving. The exclusion requires two years of ownership and use as your main home within the five years ending on the sale date, so once your last two years of residence slide out of that five-year window, the exclusion is gone. Renting during the window does not shrink it, and qualifying military, foreign-service, intelligence and Peace Corps duty can suspend the clock for up to ten years. After the window closes, a 1031 exchange is the remaining way to defer the gain.
At a glance
| Test | 2 years of ownership and use within the 5 years ending on the sale date |
|---|---|
| Two years means | 24 full months or 730 days, not necessarily in a row |
| Practical deadline | About the third anniversary of move-out, after two years of residence |
| Renting in the window | Not nonqualified use; the exclusion is not prorated |
| Duty suspension | Up to 10 years for qualified official extended duty |
| Partial exclusion | Only for sales caused by job change, health or unforeseen events |
| Depreciation | Taxable or deferrable whatever the timing |
| After the window | A 1031 exchange, if the house is held as a rental |
The look-back window moves with your closing date
Section 121(a) excludes gain if, 'during the 5-year period ending on the date of the sale or exchange', you owned and used the property as your principal residence 'for periods aggregating 2 years or more'. Each day you wait pushes the start of that five-year window forward a day.
Reg. section 1.121-1(c)(1) lets you count 24 full months or 730 days, and the periods do not have to be consecutive. Short temporary absences such as vacations count as use.
So the deadline is set by your last 730 days of residence. If those ended on the day you moved out, the window closes about three years later, and every month of rent after that moves gain out of the exclusion's reach.
Renting inside the window costs you nothing extra, except depreciation
Nonqualified use, which prorates the exclusion, does not include 'any portion of the 5-year period... which is after the last date that such property is used as the principal residence', under section 121(b)(5)(C)(ii)(I). Rent after move-out is in that exception.
Publication 523 shows it with an owner who lived in a house for three years, rented it for almost two and still excluded the full gain except the depreciation.
Rent before you moved in is a different matter, covered in how non-qualified use reduces the exclusion. The depreciation slice is taxable at any timing; see depreciation recapture on a former home.
Worked example: moved out June 30, 2023
Hypothetical; run your own dates with your CPA. An owner lived in a house from 2018 until June 30, 2023, then rented it out. A sale closing on June 30, 2026 has a five-year window starting July 1, 2021, which still holds two full years of residence. The exclusion applies.
If the closing slips to late July 2026, the window starts in late July 2021 and holds less than 730 days of use. The full exclusion is lost, not prorated, because the shortfall is not caused by a job change, health or unforeseen circumstances under section 121(c).
That is why contract dates matter more than list dates. A closing that funds a few weeks late can cost the full exclusion on the gain above the depreciation. If the buyer's financing could push closing past the anniversary, build in the risk or price it, and count the days with your CPA before you list.
Duty away from home can suspend the clock for up to ten years
Under section 121(d)(9), you can elect to suspend the five-year period while you or your spouse serve on 'qualified official extended duty' in the uniformed services, the Foreign Service or the intelligence community. That means duty of more than 90 days at a station at least 50 miles from the house, or under orders in government quarters.
The suspension cannot extend the five-year period by more than 10 years, and it applies to one property at a time. Section 121(d)(12) gives Peace Corps employees and volunteers serving abroad a similar suspension.
Section 121(d)(7) also helps an owner who becomes unable to care for themselves and moves into a licensed care facility, once they have lived in the home for at least one year in the five. The military version is worked through in PCS landlords: suspension or a 1031.
When the window has closed, an exchange is the remaining deferral
A house you now hold as a rental can be relinquished property in an exchange under section 1031. Inside the window you can combine both breaks under Rev. Proc. 2005-14; after it, the exchange carries the whole gain.
If you are close to the anniversary, the decision is time-sensitive: sell before it and exclude, or keep renting and plan an exchange later. The trade-off is set out in section 121 versus 1031 for a former home and using both on the same property.
A Delaware Statutory Trust interest is one replacement that keeps the property passive and can be sized to the proceeds you need to reinvest; see traditional DST exchange solutions.
Related questions
Does renting the house for two years reduce my exclusion?
Not if the rental came after you moved out and you sell within the window. Rental after your last use as a home is excluded from nonqualified use.
Is the deadline exactly three years?
It is the date on which your five-year look-back stops holding 730 days of use. For someone who lived there two years or more right up to move-out, that is about the third anniversary of moving out.
Can a job transfer save me if I miss the window?
Section 121(c) gives a reduced exclusion only when the sale itself is by reason of a change of employment, health or unforeseen circumstances. Simply holding the rental too long does not qualify.
Can my spouse's deployment extend the window?
Yes. The election covers duty by you or your spouse, up to a 10-year extension, for one property at a time, and can be revoked at any time.
What if I moved back in for a while?
A new period of residence counts toward the two years and resets the date your last use ended. Rent before that return can be nonqualified use.
Sources
Checked against these publications on September 30, 2026. Rules and figures change; confirm the current version with your CPA or attorney before you act. This page is general information, not tax or legal advice.
