Nobody likes paying taxes on investments. But some lucky taxpayers are able to get a 0% rate on some of their investment income.

In the following video, Dan Caplinger, The Motley Fool's director of investment planning, runs through the rules for the 0% rate, explaining how it can apply to both long-term capital gains and qualified dividend income. Dan notes that on the dividend side, the rate only applies for ordinary stocks, with certain pass-through entities like real-estate investment trusts Annaly Capital (NYSE:NLY) and Chimera Investment (NYSE:CIM) paying out dividends that get taxed at ordinary income tax rates. Similarly, business development companies Prospect Capital (NASDAQ:PSEC), Ares Capital (NASDAQ:ARCC), and Main Street Capital (NYSE:MAIN) have traditionally paid out a combination of qualified and non-qualified dividend income, making their distributions only partially eligible for the 0% rate. Dan concludes that if you have room in those lower two brackets, selling stocks at a gain can be a smart move to make the most of your tax-free opportunity.

Dan Caplinger and The Motley Fool have no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.