I have done this with this same exact scenario (except for the dollar amount). I bought the house, held enough back in escrow to cover x-amount of months rent, plus y-amount for time and legal fees for eviction (should that possibility occur), plus z-amount for potential damages (once again, should it occur). Plus, I put in the lease ends in #-days and if the tenant stayed longer the rent automatically went up to $$$ per day (as incentive for him to GTFO should he get too comfortable).
The contract was also crystal clear that I would deduct any and all fees from the escrow holdback and then he would get the difference after he moved out.
PS, have a lawyer draft this for you since you need to comply with landlord-tenant laws in your state and there a lot of moving parts to this sort of addendum.
Final thoughts - I love offering this option to people when buying a house. They don’t feel rushed and get their money fairly quickly.