You should refer to HS283
as part of this answer.
A property becomes your main home when you move into it unless you make an election for another one to be treated as your main home. That doesn't necessarily mean the past when it was not your main home is forgotten and there is not a CGT liability. It depends on the facts and figures.
If you sell the property in December 2015 for £257,000 (net of selling fees but you can also claim legal fees of purchase and sale, survey fees, stamp duty) you will make a gain of £92,000. By then, you will have owned it for 112 months of which you will have lived in it for 68 and let it for 44.
Ther figures are as follows:
Exempt gain £70,643 (£92,000 / 112 months x 86 months (68 + 18))
Non exempt gain £21,357 (£92,000 / 112 months x 26 months (44 - 18))
Letting relief £21,357 (lesser of £40,000, £70,643 and £21,357)
Taxable gain £0
I hope this helps but let me know if you have any further questions.