When you sell a rental at a gain, the IRS generally taxes prior depreciation as “recapture” at up to 25%, separate from capital gains. A properly structured 1031 exchange can defer both capital gains and depreciation recapture if you roll into another like-kind property.