Good lawyer experienced in family law is key.
Remember you are opposing parties in a lawsuit and act accordingly. They are not your friend or confidante.
Your lawyer is not your therapist. If you need a therapist, get one very experienced in infidelity.
Focus on your financial and property settlement. This is your future here.
Don't fixate on the marital home. A home is more than four walls. Don't keep the house at the expense of something else. A fresh start may do everyone good.
Don't use the kids as pawns or leverage. If he other party is just an asshole but otherwise a decent parent with a bond with their children, I would encourage a parenting plan that allows both parents to spend time with their kids.
If you are unfortunate enough to be dealing with a narcissist or other disordered person, get temporary orders as soon as possible. Without orders, you have no legal recourse and they can stop paying child support, clean out retirement accounts and run off to Tahiti with the pool boy with impunity.
Most states do this automatically, but some do not. File a financial restraining order with your divorce paperwork. It is legal recourse if they drain accounts or liquidate assets.
The AP--should they still be present--is going to be able to be around your children (there are exceptions, but no third party rules are very difficult to enforce). Deal with this in therapy--individual and family.
You may have to resign yourself to parallel parenting vs. co parenting. It is not the end of the world.
Make sure you nail down things like an automobile for the children (and insurance and maintenance), college expenses, etc. Kids grow up.
I don't recommend having loose language in an agreement. Have vacations, holiday schedule, weekend parenting time hours, drop offs, notification for vacation, who has school vacation times, etc., specified. Don't leave anything to chance--you can always be more flexible, but there is no way to tighten up a loosely worded agreement and be able to enforce it. The best way to do this is by odd/even years. This way there is no doubt who has Thanksgiving in 2014.
If you have young kids, I would recommend the right of first refusal--if a parent is going to be gone during their parenting time for more than X hours, the other parent gets the option to take them (or not).
Cat