Then don't buy it. Because that's all you are going to have is trouble, expensive trouble that may take many months to resolve.
You got that right.
You begin with your purchase contract. Make your purchase contingent on the seller getting those people out by close of escrow and if they aren't out by close of escrow you don't close.
Unfortunately, I'm betting that it's already too late for that strategy because you likely already have a purchase contract in place that doesn't have that contingency and it's too late to put it in now.
If, by chance, you haven't written the purchase contract yet, you now know how to avoid stepping into the bear trap and having your leg chewed off.

