When you sell a property, any gain is deemed to have accrued evenly over the entire period of ownership.
If you sell the property in July 2014 for £200,000 having paid £99,000 for it in 2001 you will make a gain of £101,000. By that time you will have owned it for 159 months of which you will have lived in it for 80 and it will have been vacant (certainly not let) for the most part for 79.
The gain for the period the property was your main home will be exempt from CGT as will the gain for the last 18 months of ownership (the last 36 months for exchanges of contract by 5 April 2014). That will account for £62,252 (£101,000 / 159 x 98). The remaining gain of £38,748 is that part of the remaining gain which is not covered by the last 18 months of ownership (£101,000 / 159 x 61). The first £11,000 of the remaining gain will be covered by the annual CGT exemption so you will be left with a net taxable gain of £27,748.
Had the property been let, you would have qualified for letting relief which would have covered the remaining gain resulting in no CGT liability. Whilst a friend stays there at weekends, the real problem is that you also use the property, albeit infrequently. You can read about letting relief here.
There are two rates of CGT, 18% and 28%. The rate or combination of rates you will pay will be dependent on the level of your income in the tax year of disposal of the property. Assuming you sell the property in the 2014/15 tax year, the following will apply:
1 If your income in 2014/15 including the taxable gain is £41,865 or less, then all the taxable gain will be taxed at 18%.
2 If your income in 2014/15 excluding the taxable gain is more than £41,865, then all the taxable gain will be taxed at 28%.
3 If your income in 2014/15 excluding the taxable gain is less than £41,865 but more than £41,865 when you include the taxable gain then part of it will be taxed at 18% and part at 28%.
I hope this helps but let me know if you have any further questions.