That is a different situation. Here you are moving in and out quickly and will retain the property. It could be viewed that the dominant purpose was the tax benefit of establishing it as the main residence for the 6 year absence rule.
See also TD 51 (now withdrawn, but still relevant)...
But will this be enough to establish it as your main residence? Get some advice if this is your intention.
Also if you intend to claiming expenses you will need to consider what effect, if any, renting to a related party for under market value has.