Owner questions

Lived In It, Then Rented It: Using Section 121 and a 1031

In the right timing window, yes. IRS guidance lets an owner exclude gain under the home sale rule and defer the rest with a 1031 exchange in the same sale.

Published October 22, 2026 | Last reviewed October 2026

Short answer: often yes, if the dates line up. If you owned and lived in the property as your main home for at least 2 years during the 5 years before the sale, and it is a rental held for investment when you sell, IRS Revenue Procedure 2005-14 lets you apply the home sale exclusion first and then defer the remaining gain with a 1031 exchange.

This comes up often around Sacramento. An owner buys a house in Natomas or Elk Grove, moves for work or family, keeps the old place as a rental, and a few years later wants out of landlording. The question is whether the old home rule and the exchange rule can both help on one sale.

The Two Rules Involved

Section 121, the home sale exclusion

Section 1031, the exchange rule

On their own, the two rules seem to point in opposite directions. One is for homes. The other is for investment property. Rev. Proc. 2005-14 explains how a single property can satisfy both.

Why the Dates Matter

Section 121 does not require the property to be your home on the day you sell. It looks back over the 5 years ending on the sale date. That creates a window.

If you moved out more than 3 years ago, the 2 out of 5 test is usually no longer met, and the home sale exclusion drops out. A 1031 exchange may still be available on its own. Your CPA can check your exact dates.

The Order of Operations

Rev. Proc. 2005-14 sets out how the two rules work together.

  1. Section 121 goes first. The exclusion is applied to the gain before Section 1031 is applied.
  2. Depreciation is handled by Section 1031. Gain from depreciation claimed for periods after May 6, 1997 cannot be excluded under Section 121, but Section 1031 may defer it.
  3. Cash is treated more kindly than usual. Cash or other non-like-kind property you receive is taken into account only to the extent it exceeds the gain excluded under Section 121.
  4. Basis goes up by the excluded gain. In figuring the basis of the replacement property, the gain excluded under Section 121 is treated as gain recognized, so it is added to basis.

The IRS Example, Step by Step

The first example in Rev. Proc. 2005-14 shows the result. An unmarried owner buys a house for $210,000 and lives in it from 2000 to 2004. From 2004 to 2006 the owner rents it out and claims $20,000 of depreciation. In 2006 the owner exchanges it for a townhouse worth $460,000, to be rented, plus $10,000 in cash.

ItemAmount
Amount realized$470,000
Adjusted basis$190,000
Realized gain$280,000
Excluded under Section 121$250,000
Deferred under Section 1031$30,000

That last point matters later. A higher starting basis on the replacement means less gain if you eventually sell it in a taxable sale.

The example uses dates from 2000 to 2006 and an unmarried owner. It illustrates the method. It is not an estimate of your taxes.

Two Rules to Check Since 2005

Nonqualified use

Section 121 now reduces the exclusion for gain allocated to "periods of nonqualified use," meaning time after December 31, 2008 when the property was not your principal residence. There is an important exception: any part of the 5-year window that comes after the last date you used the home as your principal residence is not counted as nonqualified use. For the typical "lived there, then rented it" owner, that exception is what keeps the rental years from shrinking the exclusion. Owners who rented the property first and moved in later are in a different position.

The 5-year rule on exchange property

The rule also runs in reverse. If you acquire a property in a 1031 exchange, Section 121 does not apply to a sale of that property during the 5 years beginning on the date you acquired it. Owners who plan to move into a replacement property someday should know this before they buy.

California Notes

Before You List

Common questions

Can I use the home sale exclusion and a 1031 exchange on the same property?

Yes, in some cases. Rev. Proc. 2005-14 lets an owner who meets the 2 out of 5 year home test, and who holds the property for investment at the time of the exchange, exclude gain under Section 121 first and defer the remaining gain under Section 1031.

How long can I rent out my former home and still qualify?

Section 121 requires 2 years of home use during the 5 years ending on the sale date. That generally means the rental period before the sale is under 3 years. Check your exact dates with a CPA.

Is depreciation on my former home excluded?

No. Gain from depreciation claimed for periods after May 6, 1997 cannot be excluded under Section 121. Under Rev. Proc. 2005-14, Section 1031 may defer that gain.

Is cash I take out of the exchange taxed?

Under Rev. Proc. 2005-14, cash or other non-like-kind property is taken into account only to the extent it exceeds the gain excluded under Section 121.

Next step. Request a referral to a local qualified intermediary, CPA or advisor.

Sources

  1. 26 U.S. Code § 121, Exclusion of gain from sale of principal residence.
  2. 26 U.S. Code § 1031, Exchange of real property held for productive use or investment.
  3. IRS, Internal Revenue Bulletin 2005-7, Rev. Proc. 2005-14 (applying Sections 121 and 1031 to one exchange).
  4. California Franchise Tax Board, Capital gains and losses.
  5. California Franchise Tax Board, 2026 Instructions for Form 593, Real Estate Withholding Statement.

Sources checked October 22, 2026. Last reviewed October 2026.

General information only, not tax or legal advice. Consult a CPA or tax attorney.