Read your contract language. Does he have the right to do so?
If not, you need to decide whether you want to assert your rights under the contract. That can be stressful and ugly and if he really needs to sell, then you may be able to settle on a small cash consideration to you from the owner for you to leave now..
He does have the ability to sell with you still in the home. So maybe there is more to this story.
Either way, you are probably looking for another place to live. This is a good example of why home ownership has its benefits.