看了这边的见解似乎也是觉得就算股票取得是 effectively connected with US，卖掉该股票得到的 capital gains 依然是 not effectively connected with US 的样子
In general, capital gain from the sale of securities by a non-resident alien is foreign source income;(43) as such, it is not taxable to a non-resident alien as either “fixed and determinable” income under Section 871(a) or ETBUS income under Section 871(b). Therefore, if the non-resident alien realizes capital gain by selling the stock underlying the option (as opposed to income from the exercise of the option), the capital gain is foreign source income and non-taxable.
– “Exercises of Employee Stock Options by Non-resident Aliens”, Stafford Smiley at internationallawoffice dot com
其实之前就是没有完全确定是不是 effectively connected income (ECI)，比如说如果是 sale of real property 就会是
Gains and losses from the sale or exchange of U.S. real property interests (whether or not they are capital assets) are taxed as if you are engaged in a trade or business in the United States. You must treat the gain or loss as effectively connected with that trade or business.
但 IRS 的这句
Generally, when a foreign person engages in a trade or business in the United States, all income from sources within the United States connected with the conduct of that trade or business is considered to be Effectively Connected Income (ECI).
这说法乍看之下会让人觉得 stock 如果 ECI 那 sale of 该 stock 也有点 ECI 的感觉