Maryland Family Law Article section 8-208(a)(1) lets the court give one spouse sole possession and use of the family home, or divide possession and use between the spouses. The court acts this way regardless of how the home is titled, owned, or leased. Section 8-208(a)(2) says the court is allowed to use these powers while the case is pending.
Section 8-208(b) says the court shall consider the best interests of any child, each spouse's interest in continuing to use the home as a dwelling, and any hardship on the spouse whose interest is infringed.
Section 8-208(c) lets the court order either or both spouses to pay the mortgage or rent, related debt, maintenance, insurance, assessments, taxes, or similar expenses.
The statute text states no rule on abandonment, on the effect of leaving, or on your rights after you leave. This page states none either. Ask your attorney before you move.
Next step: put the terms in writing before you pack. Use the checklist below.