The Capital Gains Tax relief you refer to is Principle Private Residence (PPR) relief. This is only available to the owner of a house if you occupy it as your only or main residence. Unfortunately, an intention to occupy is not sufficient to qualify for this relief.
It is not necessary to have lived in the property as the only or main residence for all the period of ownership, as the relief is pro-rated, but it must have been occupied for at least part of the period of ownership as your only or main residence.
HM Revenue and Customs guidance states that to qualify, “Residence is one of quality rather than the length of occupation which determines whether a dwelling-house is its owner's residence”. A property must have become its owners home at some point during ownership even though no minimum period of occupation is required.
There is an exception to this rule if you live in job related accommodation and own an interest in a property which you intend to occupy in due course as your only or main residence. Provided it was always your intention during to live in the property, PPR relief will be available for the period concerned, even if it is being let out whilst you are living in another property for the purposes of your job.