Do foreigners pay capital gains tax on US stocks?
I'm a nonresident alien living in Germany, and I've been investing in US stocks through a brokerage account for about two years. Sold some positions this year and realized gains. My broker sent me a 1099-B but I've also heard that nonresidents might not owe US capital gains tax at all on stock sales. I'm not sure if that's true or if it depends on what kind of gains they are. I tried reading the IRS page on nonresident aliens but it's dense. Do foreigners pay capital gains tax on US stocks, and if so, do I actually need to file anything with the IRS? Does it matter whether the gains are short-term or long-term?