Basically, if your taxable income is under $38,600 single/$77,400 MFJ then all qualified dividends and LTCG are taxed at 0%.
If your ordinary income exceeds $38,600 single/$77,400 MFJ then all qualified dividends and LTCG are taxed at 15% (or more when income gets really high).
If your taxable income is over $38,600 single/$77,400 MFJ but ordinary income is under, then the excess over $38,600 single/$77,400 MFJ is taxed at 15% and any dividends and LTCG under $38,600 single/$77,400 MFJ are taxed at 0%.
The graphs in the middle of this article may be useful in understanding the principle... but the dollar amounts have increased since 2014 when the article was written.
https://www.kitces.com/blog/understa...p-up-in-basis/