You can potentially minimize or avoid capital gains tax by selling capital assets after you've retired, investing within a tax-deferred retirement plan or offsetting capital gains with capital losses. For real estate sales of primary residences, homeowners are exempt from capital gains taxes on the first $250,000 of the sale’s capital gain if they are single and $500,000 if they are married and filing a joint return. This exemption can only be used once every two years.