After you file for divorce, you can file a motion asking a judge to award you exclusive possession of your home. This may not be as easy as it sounds, however. The court will want a very good reason for letting you stay and making your spouse go. His presence in the house must usually create such intolerable, stressful conditions that no one would expect the two of you to continue to reside there together. You'll need proof – you can't just make the allegation and expect the judge to take your word for it. If you're in actual physical danger, you can file for a restraining order and this would also remove your spouse from the home.
Negotiating an Agreement
Your spouse might not want to leave because you don't yet have a parenting plan in place, or because it's unclear who will pay for what. After you file for divorce, you can file a motion with the court, asking a judge to resolve these issues temporarily until your proceedings are final. If they're resolved, your spouse might be more willing to move out. If you can reach a settlement agreement on your own, resolving all issues of your marriage, not only might he move out, but your divorce will be uncontested as a result.