-
There is capital gain tax exemption for your primary residence
up to $250,000 for a single person and up to $500,000 for a couple filing
jointly if you lived in that house at least for two years out of past 5
years at the point you sell the house. You get the exemption even if you lived
there less than 2 years if you had to sell the house for imperative reasons such
as your job transfer.
Your realtor’s comment is unheard of. I can’t see why foreigners should be different.
realtors are not nessessarily tax specialists. I think you need to make a call to an accountant.