Capital gains DO NOT count against your Social Security earned income limits! But they can cause you and your spouse to pay more for Medicare via IRMAA (the surcharge the rich pay for Medicare Parts...