First, hire the best divorce/family law attorney you can afford! If you live in a community property state you will get 50% of all assets, and usually 50% of the debt. If you don't, you'll have to draw up a community property agreement with your wife. You will also have to draw up a child custody agree with clear visitation schedules and also for Child Support. Your maintanance, or "alimony", is a seperate agreement. If your wife is uncooperative in any of these areas, you can still draw up these agreements, only now, instead of being called "agreements" they'll be called "demands" or "requests", depending on your court's legaleze.
Also, fathers, whether they are stay at home parents or not, frequently have an uphill fight trying to win custody of their children if the mother wants to resume her duties as full time parent. You must be assertive, clever, thorough and convincing. And you need to have a skillful attorney!
If you and your wife are in agreement on everything, you can save a chunk of money if you buy the legal forms and fill them out yourselves. Be careful though, make sure all your jots and tittles are dotted and crossed! And never ever go into a court room to face a judge without a skilled attorney!
Impress upon your attorney the importance of your being able to continue being a stay at home father. It will create a continuity of nurturing and security as well as reinforce a good example of self discipline for the children.
I wish you and your children (and wife too) well!