AFAIK (though I'm not an expert), there is no minimum period that you have to live there. Once you are not living anywhere else at that time, the new house is your PPR and you won't get hit for CGT when you sell.
I did hear unsubstantiated stories of families who build a new house every 3-5 years and move in/out of the new house to avoid CGT. The pain/cost of moving house would be a big detterent for me. There is also the possibility that Revenue could deem you to be carrying out a 'trade' if you did this a number of times and hit you for income tax on the profits.