application of capital gains tax rules to non-residents