Let's do a little story problem:
- You invest in a broad basket of stocks for $100,000
- You later sell them for $110,000
- Capital gains rate on this is 20%
- How much taxes do you owe?
Obviously, since you gained $10,000 net, and tax rate is 20%, you then owe $2,000 in taxes.
But this is only because losses offset gains. All the stocks in your basket didn't go up 10%. Some went up more, some actually lost money. It's not unusual that the losing stocks might go down $50,000, while the gainers go up $60,000, thus giving you the 10% net return, if you are investing in high-risk/high-reward stocks.
What if instead we change the tax code to only count the winners, ignoring the losing stocks. Now, instead of owing taxes on $10,000, you owe taxes on $60,000. At 20% tax rate, this comes out to $12,000 in taxes -- which is actually more than you earned on your investments.
Taxing only investments that win, while ignoring losers, is bad tax policy. It would mean, essentially, taxing investments at greater than 100% rate. This would mean people would stop investing, because it would only lose money. It's a stupid tax policy, which is why no country does it. All countries tax the net gain on investments, gains minus losses.
In the above story problem, we bought and sold the stock all at once. In the real world, people buy and sell a little bit at time over the years. It doesn't change the basic math. For that reason, losses in one year can be carried forward to offset gains in later years. You can't (easily) do the reverse, offset previous years, because you've already paid the taxes. You don't want the government giving Trump a $200-million tax refund check when he loses $1-billion.
Thus, there's nothing wrong with offsetting $1 billion gains in later years with $1 billion in losses. He's not avoiding taxes on the gains for 18 years -- it instead means that he has no gains over that 18 year period (assuming after the loss, he fails to earn $1 billion to catch back up). That he might have been earning no money, net, for 20 years is the big story -- not that he's taking advantage of some loophole in the tax law.
Offsetting future gains with past losses is not a loophole. Everybody who invests, and hence sometimes has losses, does it. Every country's tax code, like France, Sweden, or any socialist paradise you care to name, works the same way.
That's why Trump is going to win this election. The press knows how taxes work, but they intentionally twist the story to make Trump look bad. The real story with these returns is that Trump is, in fact, a shitty investor, not that he's a tax cheat.
By the way, I am a tax cheat. I had losses in the 2009 crash. Instead of immediately using those losses to offset gains in 2010 and 2011, I waited until Obamacare came into effect, which raised my tax rates. Only then did I claim the losses against gains, saving an extra few percent on my tax bill, and screwing the government out of a few thousand dollars (in a totally legal way).
There's a few bad tax loopholes in the system, like the ones hedge fund managers use, but overall, you really can't avoid paying taxes. You can shift things around a bit to change which taxes you pay, such as the above example, but that the rich use tax loopholes to avoid taxes is a myth. Indeed, in terms of taxes payments received by the government, most of them come from the rich -- at a higher rate than they come from the poor -- minus the odd hedge fund manager.