It should be just as legal for the two of you to live together in the house after your divorce as it would have been for the two of you to live there together before you were married in the first place.
Now that you are divorced, you are no longer legally related by blood or marriage. Unless there is some enforceable local ordinance that prohibits persons who are not members of a family or otherwise related by blood or marriage from residing in a single dwelling unit — and some localities may still have such laws on the books in a misguided effort to enforce their concept of morality or to restrict partying — you should be perfectly fine. Of course if you rent the house you also should check what the lease says as some leases restrict occupancy to members of a family,
It would likely make sense for the two of you to have a written agreement on the sharing of various household expenses, that also makes it clear that neither of you is able to incur expenses on behalf of the other — which you could have done while married. If you own the house in which you want to continue living, it also would make sense to change the deed, so that each you has shared ownership — as “tenants in common” — such that if one of you were to die that person’s share would pass to his or her relatives and not the former spouse (which would have been the case if the property were held as community property, tenants by the entirety, or as joint tenants with right of survivorship.
In addition, to the extent that you may have had auto insurance in both your names before, now each of you should carry your own auto insurance policy on your own car or truck. You’re not a family any longer. The lawyers who handled your divorce are the best sources of information for advice you can rely upon to make sure you don’t run afoul of any laws or (if you live in a common law marriage state) wind up inadvertently getting married to each other again.
If you have any beneficiary designations in force — whether on life insurance, bank or brokerage accounts, or retirement savings accounts such as IRAs, 401(k) plans, and the like, it may be time to change them as well.