Provided a property was actually your only or main residence at some time in the past, prior to 6 April 2014, the last 3 years would automatically be treated as your main residence even where factually it was not. This was partly to allow you time to sell the property and find another home.
From 6 April 2014, this 3 year period is reduced to 1.5 years.
Thus for sales of second homes after 6 April, more capital gains tax will probably arise.
For example, if you bought a home for £250,000 on 1 April 2002, lived in it for exactly 3 years before moving out and renting it, and then you sell for £400,000 on 1 April 2015, the exempt part of the gain would be:
£150,000 (being £400K less £250K) x (3 + 1.5)/13 = £51,923
The taxable gain would thus be = £98,077
Before 6 April 2014, the exempt part of the gain would have been:
£150,000 x (3 + 3)/13 = £69,231
The taxable gain would thus have been = £80,769
(I have ignored letting relief in the examples above which would further reduce any taxable gain)