A 1031 exchange is a real tool, but it applies to investment property, and a primary residence plays by different rules. In a 1031, or like-kind, exchange, you sell an investment property and roll the proceeds into another investment property, which defers the capital gains tax rather than triggering it at sale. The rules are strict and the deadlines tight: you must identify and close on the replacement property within set time limits, and the funds typically must sit with a qualified intermediary. The structure has to be set up correctly before you sell. A primary residence gets its own relief: the capital gains exclusion, which shields a portion of the gain if you meet the ownership and use tests. There can also be planning room where a property has been both, for example converting a former primary into a rental, though the rules on how much exclusion survives and for how long are specific. And holding property until it passes to heirs can give them a stepped-up basis, which is its own way of reducing or avoiding gains. Because the deadlines and eligibility on a 1031 are unforgiving, line up a qualified intermediary and a CPA before you list, never after.