Can I avoid capital gains tax on a buy-to-let property?

Guardian Article from 11th July:

Q: I would like to buy a flat with a view to letting it out. It would be the only property I own. I currently live with my partner in a property they own. I am confused over capital gains tax (CGT) liability and, in particular, the amount of time you must live in a property before renting it for it to qualify as your main residence. Or is this about quality rather than quantity, in terms of electoral register, address for bank and other correspondence etc?

Would it be worth living in the property for a certain period before renting it out, with a view to selling it within 36 months of renting it, in order to avoid CGT? How long would I have to live there for, and does this mean changing all my address details for banks etc? SM

A: It is not a question of whether it is worth living in a property to avoid CGT, it's a requirement. A property does not count as your main residence for CGT purposes, and so qualify for private residence relief which makes gains tax-free, unless it is your home and you live there (subject to various work-related exceptions which don't apply in your case).

Pretending to live there by using a property's address for correspondence and so on won't do, nor will living there for a short amount of time simply to claim it as your main residence. A tax official would smell a rat if your address was the same as your partner's, changed to the property you intend to let and then back to being the same as your partner's.

So there isn't a minimum amount of time you have to live in a property for it to be considered your home – it does actually have to be your home.