Who taxes capital gains for non-resident alien with no tax residency anywhere?
Trying to figure out a genuinely confusing situation. I hold US brokerage accounts and sold some ETFs this year with significant gains. I'm not a US citizen or green card holder, I don't pass the substantial presence test, and my home country lost my tax residency status when I left two years ago. So right now I have no tax residency anywhere officially. My broker sent a 1099-B and is asking me to certify my status. Who actually taxes capital gains for a non-resident alien with no tax residency anywhere? Does the US get to tax me on ETF gains just because the account is here? I've been going back and forth on whether I even need to file a 1040-NR. Would really appreciate any guidance from people who've dealt with this.