You would need to look at your lease agreement.
I would think you could sell the home, but the new owner would likely need to honor the lease agreement.
So a couple of considerations....if you lease first, then likely you will need to sell to an investor, if you want them to take the tenant. Remember investors look at CAP rates, so to get the highest price for your home while leased, you also want a high lease rate.
If you plan to lease now, but sell to a retail investor towards the end of the lease, remember most tenants (not all) may not keep the house in tip top show ready condition like you would. That might mean a lower sales price. Depending on your relationship with the tenant they may also spill all their guts with a potential buyer about every defect or inconvenience. Most sellers want to be out of the house while buyers look. I find tenants want to be HOME while people are looking. This combination of events doesn't always mean top dollar in a sale.
Just a couple of things to consider. Good luck.