Quote from @Robert Weissfeld:
My primary residence is a duplex. I want to sell it and take the profit from the primary res half, and reinvest the other half via 1031 exchange (I believe that is the correct designation).
Q1: Do I actually have to rent out the new property, or can I move into it myself and keep the tax deferment?
Q2: If I sold the new property in the future (after living there for at least 2 years) would it again be considered a primary residence and get the 250k cap gains deduction?
@Robert Weissfeld,
Yes, you can sell, cash out half, and 1031 exchange the other half. The half of the duplex that you are living in will qualify for Section 121 exclusion if you've lived in it for at least 24 months out of the prior five years. This exclusion allows you to ignore up to $250K of capital gain (or $500K if married filing jointly) on the half that you live in. Huge benefit.
You can't directly 1031 into another primary residence. As Dave points out, only real estate held for business or investment use qualifies for 1031.
You can move into the new property after holding for investment initially. The safe rule of thumb here is to treat your new property as an investment for at least 24 months before moving in, AND making sure to rent out the new property for at least 14 days per year while it's an investment.
You can buy the new investment, then move in, and then sell, and then get some tax benefits. Let's suppose you find a property via 1031, then rent it out for a few years before moving in. All good - no issues there. This happens all of the time. The suppose you live in it for another couple of years and sell again -- do you get the Section 121 exclusion? Yes, but not entirely.
This gets a little wonky, but the IRS is going to look at that future sale and allocate the built up capital gain pro rata between the amount of time it was a primary residence vs the amount of time it was a rental. Here's a scenario: you rent the property for two years, then move into it for three years. If you sell that property at a $200K gain, for example, then only the gain allocable to the three years is eligible for exemption under Section 121, and the gain allocable to all of the rental years even going back to your original duplex will not be exempted under Section 121. In this scenario, you're likely only able to use the exemption for less than half of the $200K gain.
One more thing: you will never be able to exempt the depreciation recapture in the future by selling as a primary residence. That recapture will be taxed at 25% regardless of how long you lived in the new property.
All this to say that you should work with detail-oriented experts if you really want to go down this route, because it's easy to get a little sloppy and end up with a much bigger tax bill than you expected.