Here is a simplified example on how zero tax on capital gain works.
Say that Jane is a single taxpayer with $30,000 of taxable ordinary income for 2021 after deductions. Her taxable income is subject to rates up to 12%, as detailed in the income-tax brackets.
But Jane also has a $15,000 long-term capital gain. This “stacks” on top of her
$30,000 of taxable income, giving her total taxable income of $45,000. For 2021,
the 15% bracket for capital gains begins at $40,401 of taxable income for single
filers. As a result, Jane would owe zero tax on $10,401 of her gain and 15%
on $4,600 of it.