Yes and no. If your spouse agrees to move out, then the problem will solve itself. If that is not the case, then you may need to resort to other measures.
Unless there has been violence or a serious threat of violence in the relationship, the judge cannot exclude either spouse from the home without a hearing. After a temporary hearing, the judge will usually order that one party is to have the exclusive use of the residence and order the other party to move out.