Avoiding capital gains tax?!?!?

Hi, i live at home but own 1 flat with a buy to let mortgage on it. i am currently selling it but want to avoid the capital gains tax, is it true i can change my residential address to this propery thus avoiding the tax? if so how long must i theoretically live there and must i change my address with mortgage company, bank, post office (basically e one)? any advice would be brilliant.
Answer
It depends how long you have been using the property for