@shawnab Right, this applies to dividens and I meant for accounts where you have invested after tax money, not 401k or IRAs.
As per the capital gains if the country has a treaty with US and you have filled correctly the form W-8BEN, no tax should be withheld in US. It will be your...