What can you do if your ex doesn't want to leave home after a separation and keeps looking for sex with you?

You couldn't have gotten a legal separation because you would have signed papers to have your ex stay away from you. You need to see a lawyer and get these papers drawn up. Make up your mind! Either separation and he doesn't live there anymore or divorce. Separation is best because it gives each of you time to reflect on your past relationship and a chance to cool off so you can make a better judgment call as to whether to get divorced or not.

See that lawyer, get those papers and then he'll have to leave.