How long do i have to live in my principle dwelling to avoid paying capital gains tax?
In general so long as you live there and do not have another house it is CGT free from day 1. If you let out part of the house (whether you move out or not) and do not nominate another house as your Principal Private Residence that part will not qualify for PPR but will receive some letting relief which may remove the gain in full. The last three years of occupation are ALWAYS allowable, so you could in theory move out for the last three years and let the property and it would still be 100% free of tax. That is the basics, there are lots of other little rules mostly based on why you aren’t there for certain periods and such. If you were going to do anything other than occupy it it would be worth talking it over with someone (or posting on here) to be sure.