There is no minimum period in the legislation. You must simply establish it as your principal resident for a period before becoming temporarily absent.
Plan ahead a bit.
You can do both - buy a PPOR and live in it shortly then rent it. Benefits = CGT exempt and you get to claim all deductions (if set up right).