There are no tax consequences. But there could be issues with the lender. It just depends on your loan agreement.
Typically, a loan taken for the purpose of purchasing a primary residence and/or second home will commonly have provisions that the property be used within the constraints of the loan type. For example, taking out a residential loan for commercial property would be fraudulent.
Typically if you take out a residential loan for a primary residence or second home, the loan terms require the property to be used as such for at least the first 2 years of ownership. Then after that if you move out and convert it to a rental you're not violating the loan agreement.
So overall your question is not a valid tax question. But it is a valid question for the lender. Check your loan agreement documents.