Job-Related Accommodation
Generally speaking, a property is only your main residence while you are actually living there, but there are certain exceptions, such as living in job-related accommodation.
This relief is not often available, because the definition of job-related accommodation is very strict.
The object of the relief is to enable someone who has to live in a particular place (such as the manager of a pub required to live on the premises) to buy a house elsewhere (perhaps for his retirement) and have it treated as if it is his main residence, even though he has not yet lived there.
In some circumstances, this relief is also available to the self-employed and to owners/directors of companies.
Provided that it was genuinely your intention to live in the house in the future, it is possible for the house to be sold and the gain to be exempt, even if you have never lived there, but HMRC are likely to look very closely at the facts in such a case.
A word of caution
If you think you may be in this situation, do not just assume your present accommodation is job-related and that you will qualify for this relief – check with a tax adviser as the rules are strict, complicated and illogical, like a lot of tax rules.

Blog
Property Tax Made Easy