Retirement tax questions

Yes and yes, but it's more complicated than that, and you can't have unlimited capital gains at zero percent.

 

Suppose your income is $55,000, your AGI taxable income after your standard deduction is $42,450, just over the o% bracket.  Now suppose you contribute $1000 to a deductible IRA, so your AGI is now $41,450.  You don't make the entire capital gains tax-free, just the first $250, and the rest are taxed at 15% per usual. 

 

Remember your AGI taxable income is after your deductions, probably the standard deduction in your case.  So if your gross income is $46,000, your AGI taxable income is around $33,500.  Without doing anything else, the first $8000 or so of your gain is tax-free.  If you reduced your AGI taxable income further with a deductible IRA contribution, then more of your gain is tax free by the same amount.  But you never make the entire gain tax free unless your total AGI income including the gain is less than the threshold.