Sometimes you have a year with unusually low income. Often times there is a period of years after you have retired when your income is unusually low. You no longer have a large salary and you are not yet required to take distributions from your IRA/401k (until age 70.5). This is particularly true if you have chosen to delay your Social Security benefit to age 70 to take advantage of the delayed retirement benefits which increases your benefit by 8%/year. During that period of relatively low income you may be able to take advantage of the 0% tax rate on long term capital gains, if your taxable income is under $37,950 (single 2017) or under $75,900 (married filing jointly). However, it is important to note that the 0% rate only applies to that portion of the gain that ‘fills up the 15% income tax bucket’. For example, if a married couple has $40K in part-time earnings, $4K in interest and dividends, and $16K in an employer pension (total $60K), and a standard deduction of $12,700, and $8,100 in exemptions (taxable income of $39,200), they can take an additional $36,700 in long term capital gains at a 0% rate. But if their gain was $40,000 for example, then the $3,300 above the excluded $36,700 would be taxable at the 15% capital gains tax rate.
Note that this only applies to long term capital gain. Short term gains (positions held less than one year) are taxed at the regular tax rate.
Disclaimer: This is a simplified example. Please contact your tax accountant or financial advisor for tax advice specific to your situation.