Most investors treat the home sale exclusion and the 1031 exchange as separate tools for separate situations. One is for the house you live in. The other is for the rentals you own. But the tax code does not force you to choose. When a single property has served as both a residence and an investment, you can stack Section 121 and Section 1031 in the same sale and walk away owing little or nothing in capital gains tax.
This is one of the most underused strategies available to high-income real estate investors, and it rests on a specific piece of IRS guidance that has been on the books for two decades.
Two tax breaks that were built to work together
Section 121, the home sale exclusion, lets you exclude up to $250,000 of gain on the sale of your primary residence if you file single, or up to $500,000 if you are married filing jointly. To qualify, you must have owned and used the property as your main home for at least two of the five years before the sale.
Section 1031 is the engine behind every 1031 exchange. It lets you defer the gain on real estate held for investment or business use by reinvesting the proceeds into like-kind replacement property through a qualified intermediary.
In 2005, the IRS issued Revenue Procedure 2005-14, which formally blessed the use of both provisions in a single transaction. If your property qualifies for the residence exclusion on one portion and the investment deferral on another, you can apply each to the slice of gain it covers.
The order of operations matters
Revenue Procedure 2005-14 lays out a specific sequence. You apply Section 121 first, excluding the gain tied to the residence portion up to your $250,000 or $500,000 limit. You then apply Section 1031 to the remaining gain on the investment portion, deferring it into replacement property.
There is one wrinkle that trips people up. Section 121 cannot exclude gain attributable to depreciation you claimed after May 6, 1997. That depreciation recapture is taxed at rates up to 25 percent and the home sale exclusion will not touch it. The good news is that Section 1031 can defer it, as long as the recapture sits on the investment portion of the property and you roll that portion into a like-kind exchange.
Worked example: A duplex you live in and rent out
Picture a married couple who buy a duplex for $400,000. They live in one unit and rent the other, a clean 50/50 split of the building. Over the years they claim $60,000 of depreciation on the rental unit.
They later sell the duplex for $900,000. To apply the two strategies, they treat the property as two halves.
The residence half. Sale price allocated to their unit is $450,000. Their basis in that half is $200,000, so the gain is $250,000. Because they are married filing jointly and meet the two-year use test, Section 121 excludes the full $250,000. Tax owed on the residence half is zero.
The rental half. Sale price allocated to the rented unit is also $450,000. Their basis started at $200,000 but drops to $140,000 after $60,000 of depreciation, producing a $310,000 gain. The home sale exclusion does not apply to this half because it is not their residence. Instead, they roll the rental proceeds into a replacement investment property through a 1031 exchange, deferring the entire $310,000, including the $60,000 of depreciation recapture.
The result: $250,000 of gain excluded permanently, $310,000 of gain deferred, and a federal capital gains bill of zero on a $560,000 total gain. The couple keeps their capital working instead of sending a quarter of it to the IRS.
The savings reach beyond the headline capital gains rate. High earners also face the 3.8 percent net investment income tax on gains that land in their taxable income. By excluding the residence portion and deferring the rest, the couple keeps that surtax off the table for now as well. Every dollar that stays invested instead of going to tax continues to compound in the replacement property, which is the entire point of pairing these two provisions.
The other direction: Exchange into a rental, then move in
The strategy also works in reverse, though the rules are stricter. You can complete a 1031 exchange into a rental property, hold it as an investment, and later convert it into your primary residence to capture part of the Section 121 exclusion when you eventually sell.
Three requirements govern this path. First, under Section 121(d)(10), you must own the property for at least five years from the date you acquired it in the exchange before any exclusion is available. Second, you must meet the usual test of living in the home for at least two of the five years before you sell. Third, you should genuinely hold the property as a rental first, commonly for at least two years, so the original exchange holds up as an investment.
There is a further limit. For any period after 2008 that the property was not your principal residence, the gain allocated to that nonqualified use cannot be excluded. If you owned the home for ten years and rented it for the first six before moving in, roughly 60 percent of the gain is tied to nonqualified use and stays taxable, with Section 121 only sheltering the rest. Depreciation recapture from the rental years remains taxable as well.
Common mistakes that cost investors money
The single biggest error is assuming the home sale exclusion erases depreciation recapture. It does not. If you have been depreciating a rental, plan for that recapture and use the exchange to defer it.
A second mistake is failing to establish real investment intent. If you move into a property too soon after a 1031 exchange, or never rent it at all, the IRS can challenge the original exchange. Time and documentation protect you.
A third mistake is timing the qualified intermediary too late. A 1031 exchange must be set up before you close on the sale. You cannot take receipt of the proceeds and then decide to exchange. The investment portion of a combined sale needs a qualified intermediary in place before closing, which means the planning has to happen well in advance.
Finally, many investors miss the strategy entirely because they sell a former home that has become a rental without realizing both provisions are available. If a property has lived a double life, it is worth running the numbers before you list it.
Run the Numbers Before You List
Combining Section 121 and Section 1031 is neither aggressive nor a gray area in the eyes of the IRS. It is exactly what Revenue Procedure 2005-14 contemplates. But it demands careful allocation between the residence and investment portions, accurate tracking of depreciation, and a qualified intermediary engaged before the sale closes.
If you own a property that has served as both your home and an investment, or you are weighing a 1031 exchange into a property you may someday live in, the structure you choose now determines how much of your gain you keep. Our team handles the exchange side of these combined transactions every day and can coordinate with your tax advisor to map the numbers before you sell. Contact our team to walk through your situation.

