We did a rent-back agreement with the sellers for 10 days after buying our house. No issues. However, that period was short enough to not fall into the issue of being considered a rental property.
If you do a lease back, make sure you are covered as a landlord in terms of insurance, charge market rent, and have a definitive lease end date.
Also, get professional/legal help to review your lease agreement.