You can avoid capital gains tax if your profit on the sale is less than $250,000 (for single filers) or $500,000 (if you’re married and filing jointly), provided the property has been your primary residence for at least two of the past five years. For investment properties, capital gains taxes can be deferred with a Section 1031 like-kind exchange, in which you use the profit from the sale of one investment property to buy another of equal or greater value.