To me it's more or less: if you move countries with an intent to stay, then you're an immigrant. Otherwise, you're an expat. Of course an expat my become an immigrant if they decide to take roots in a place.
I’ve seen retired Brits live in southern Spain and Portugal for 20+ years calling themselves expats and not making any effort to integrate, even though they have all the intent of staying there and not returning to England.
So expat/immigrant seems like a very social/economic background distinction.
reply