top of page

Tax-Saving Double Play: Combine Home Sale with the 1031 Exchange

Updated: Apr 20, 2023

Many U.S. residential real estate markets have advanced a great deal. In many areas, values have surpassed previous highs reached before the 2008-2009 financial crisis.

And then you have the fact that many principal residences have been held for a relatively long time and are now worth far more than they cost.

If you own one of these highly appreciated homes, selling could trigger a big federal income tax gain well in excess of what you could shelter with your principal residence gain exclusion ($250,000, or $500,000 for joint filers).1

On gains in excess of the exclusions, you could suffer substantial tax bills (federal and state, unless you live in a state with no income taxes).

You may wonder, “Is there anything I can do to avoid this big tax hit?” Good question. The answer is yes, as you will learn in this article.

Combine These Two Valuable Tax Breaks

The tax-saving strategy in this article is to combine the tax-avoidance advantage of the principal residence gain exclusion break with the tax-deferral advantage of a Section 1031 like-kind exchange. With proper planning, you can accomplish this tax-saving double play with full IRS approval.2

The double play is available if you can arrange a property exchange that satisfies the requirements for both

  1. the principal residence gain exclusion break, and

  2. tax deferral under the Section 1031 like-kind exchange rules.

The kicker is that tax-deferred Section 1031 exchange treatment is allowed only when both the relinquished property (what you give up in the exchange) and the replacement property (what you acquire in the exchange) are used for business or investment purposes (think rental here).

Your first step before you make the exchange is to show that you have converted your former principal residence into property held for productive use in a business or for investment.3 According to IRS guidance, such a conversion takes two years to fully ripen.4

Principal Residence Gain Exclusion Basics

If you’re unmarried, you can sell your principal residence and exclude (pay no federal capital gains tax on) gain of up to $250,000. If you are married and file jointly, you can exclude gain of up to $500,000. To qualify, you generally must pass both of the following tests:

  1. You must have owned the property for at least two years during the five-year period ending on the sale date (the ownership test).

  2. You must have used the property as a principal residence for at least two years during the same five-year period (the use test).

To be eligible for the larger $500,000 joint-filer exclusion, at least one spouse must pass the ownership test, and both spouses must pass the use test.

If you excluded a gain from an earlier principal residence sale, you generally must wait at least two years before taking advantage of the gain exclusion deal again. If you’re a joint filer, the

$500,000 exclusion is available only if neither you nor your spouse have claimed an exclusion for an earlier sale within two years of the sale date in question.5

Treatment of Gain from Relinquished Property (Your Former Principal Residence)

The IRS says you must apply the principal residence gain exclusion rules before the Section 1031 like-kind exchange rules when you combine both breaks.6

Thank the IRS. As you will see below, applying the residence gain exclusion rule first gives you the best tax breaks.

In applying the Section 1031 rules, boot (meaning cash or property other than real estate received in exchange for your relinquished former principal residence) is taken into account only to the extent the boot exceeds the gain that you can exclude under the principal residence gain exclusion rules.

Sounds messy and tricky, but don’t worry. Later in this article, we have a clarifying example of how that works.

Basis in Replacement Property (New Property Received in Exchange)

To calculate your tax basis in the replacement property, add any gain that you can exclude under the principal residence gain exclusion rules to the basis of the replacement property. That sounds weird, but it’s in your favor. So make sure you get this done!

Subtract any cash boot that you receive from your basis in the replacement property.

The gain that is deferred under the Section 1031 like-kind exchange rules is also effectively subtracted from your basis in the replacement property. But that’s perfectly fine, because you’ve

successfully deferred what would have been a taxable gain on the disposition of your former principal residence.

The clarifying example below illustrates how this strategy can create a really big tax-saving benefit.

Clarifying Example

Your principal residence—owned for many years by you and your spouse—is worth $3.3 million.

You convert it into a rental property, rent it out for two years, and then exchange it for a small apartment building worth $3 million plus $300,000 of cash boot paid to you to equalize the values in the exchange.

Your basis in the former residence is only $400,000 at the time of the exchange. You realize a whopping $2.9 million gain on the exchange: proceeds of $3.3 million (apartment building worth

$3 million plus $300,000 in cash) minus basis in the relinquished property of $400,000. Now, let’s check on your tax bite.

You can exclude $500,000 of the $2.9 million gain under the principal residence gain exclusion rules. So far, so good!

Because the relinquished property was investment property at the time of the exchange (due to the two-year rental period before the exchange), you can defer the remaining gain of $2.4 million under the Section 1031 like-kind exchange rules. Nice! No taxes on this deal.

As mentioned earlier, IRS guidance stipulates that you first apply the principal residence gain exclusion rules to exclude $500,000 of your $2.9 million gain.

Next, you apply the Section 1031 like-kind exchange rules.

Under the exchange rules, you are not required to recognize any taxable gain, because the

$300,000 of cash boot you received is taken into account only to the extent it exceeds the gain you excluded under the principal residence gain exclusion rules.

Since the $300,000 of cash boot is less than the $500,000 excluded gain, you have no taxable gain from the boot. So under the Section 1031 rules, you can defer the entire remaining gain of

$2.4 million (total gain of $2.9 million minus excluded gain of $500,000).

Your tax results from the exchange are summarized as follows:

Your basis in the apartment building (the replacement property) is $600,000 ($400,000 basis of relinquished former principal residence plus $500,000 gain excluded under principal residence gain exclusion rules minus $300,000 of cash boot received).7

Viewing it another way, your basis in the apartment building equals its fair market value of $3 million minus the $2.4 million gain that you deferred under the Section 1031 like-kind exchange rules.

Pay No Income Taxes Ever

If you hang on to the apartment building until you depart this planet, the deferred gain will be eliminated from federal income taxes thanks to the date-of-death basis step-up rule.8

Under the date-of-death rule, the tax code steps up the basis of the building to its fair market value as of the date of your death.

Example. You die. Your heirs inherit the building at its new stepped-up basis. They sell the building for its date-of-death fair market value. Presto, no income taxes.

Of course, you do need to consider estate taxes if your estate is greater than $11.4 million.9

Converting Former Principal Residence into Rental Property

As the preceding example illustrates, you reap the big tax savings when you can reduce or eliminate the home-sale taxes by combining the principal residence gain exclusion and Section 1031 like-kind exchange breaks.

To cash in, it’s critically important that you successfully convert your former principal residence into a rental property before swapping it in a Section 1031 exchange.

The IRS guidance on how to make this work establishes a two-year safe-harbor rental period rule—without specifically calling it such.10 Although a shorter rental period might work, you know you are safe with the two years.


Imagine totally avoiding taxes on a $2.4 million gain. That’s what you just did in this example. Your real-life tax avoidance may have been more or less than the example, but now you know how you can do this.

  1. First, you make sure you meet the two-of-five-years rules on use and occupancy for excluding the $250,000/$500,000 taxable gain on the sale of your home.

  2. Next, you rent the home for two years.

  3. And then, within the five years, you complete the Section 1031 deferred exchange.

You might ask whether you could later convert a newly acquired rental to your principal residence, and the answer is yes, but you have to wait awhile so as to avoid the step transaction doctrine. That’s the subject of a future article.

And, as explained above, you have the death strategy, where your heirs totally avoid any federal income taxes on the later sale of the rental because of the date-of-death markup to fair market value.

One final point: make sure to consult a professional Section 1031 exchange intermediary before taking any exchange action.

1 IRC Section 121.

2 Rev. Proc. 2005-14.

3 IRC Sec. 1031(a)(1) 2018.

4 Rev. Proc. 2005-14.

5 IRC Section 121.

6 Rev. Proc. 2005-14.

7 For clarity of this strategy, we did not recognize depreciation during the residence rental period.

8 IRC Sec. 1014.

9 Rev. Proc. 2018-57.

10 Rev. Proc. 2005-14.

10 views0 comments

Recent Posts

See All


bottom of page