The 6 year Primary Residence rule allows you to turn your primary place of residence into an investment property for up to six years without having Capital Gains Tax (CGT) implications.
As per the ATO website, a property stops being your main residence when you stop living in it. However, for Capital Gains Tax (CGT) purposes you can continue treating a property as your main residence:
During the time that you treat the property as your main residence after you stop living in it:
For more information visit the ATO Website.
Reference: ATO