Converting primary to rental for a couple of years

I have been renting out part of my primary home on a long term and/or short term basis for the past several years and have been declaring the income and taking depreciation on my tax returns. 

 

In 2023, I got quite a few home improvements and maintenance work  done on my primary home such as brand new solar panels, a new large storage shed, attic insulation replacement, new attic fan, renovated garage, new epoxy flooring in the garage, new exterior paint etc.

 

I got laid off last month. I am contemplating on renting out my primary home for a year or maybe even 2-3 years  and moving to my second home which is not currently rentable as it needs major rehabbing work. The idea is to reduce my monthly liability so I can focus on finding a new job and also fixing the second home while staying there. However, I am not sure what would be tax implications in doing so? Will I lose my solar tax credit if I moved to the second house before one year of solar panel installation? Are there other tax consequences I should consider before making my primary home rental for a couple of years and making my secondary as primary for a couple of years and renting it out eventually once it is rehabbed?

Thank you in advance for your response.