Assuming you bought the house in 2000 and sell it in 2006, then calculations go as follows
Sales proceeds 330,000
less selling costs, say 20,000 (solicitors fees, estate aents, etc)
Net proceeds 310,000
Cost (in 2000) 150,000 (including all solicitor's fees, etc etc)
Indexation relief factor 1.144
Indexed cost 150,000 x 1.144 = 171,600
Net gain = 310,000 - 171,600 = 138,400
You owned the house for 6 years ie 72 months
You occupied the house for 4 years ie 48 months
You did not occupy house for 2 years ie 24 months (whether house is rented or not is immaterial)
Last 12 months is deemed a period of occupation irregardless of actual situation, so period of occupation is 48 + 12 = 60 months
Relief = gain x period occupation / period of ownership
= 138,400 x 60 / 72 = 115,333
Taxable gain = 138,400 - 115,333 = 23,067
Less annual allowance (if not already used) of 1,270= 21,797
Tax at 20% = 4,359
Obviously you need to substitute the exact periods of ownership/occupation (in months) as well as the costs to get a better estimate. The indexation factors depend on when you bought the house
6th April 99 - 5th April 2000 1.193
6th April 2000 - 5th April 2001 1.144
6th April 2001 - 31st Dec 2001 1.087
1st Jan 2002 - 31st Dec 2002 1.049
After 31st Dec 2002, 1 ie no indexation relief