I'm given 1000 stock options (all vested) at $100 strike price per option. Current stock valuation is $1000 per share. As I understand, if I exercise I'll pay $100K out of my pocket and I'll also get taxed on $900K capital gain (please correct me if I'm wrong here). I'm not a US citizen, but I work full-time in the USA now (resident alien), my employment contract finishes in 1 year. I'd like to understand what would happen if I exercise these 1000 stock options when I stop working in the USA, would I still need to pay IRS tax on $900K gain and then also deal with taxes in my own country, or if I exercise options while I'm not a tax resident in the USA I'll need to deal only with taxes in my country?
Seems that residency starting and ending rules might be relevant for my case.