Capital gains tax explained: 2026 and 2027 rates, how gains stack on your income, the 3.8% NIIT, home sales, losses and legal ways to pay less.