During the period its not income producing (ie owner/family occupied) then there is no CGT. So get your occ cert now.
CGT will apply on a proportionate amount from the time when rent the granny flat out in the future until a CGT event is triggered eg sale. You cant avoid it (unless you want to...