The first thing you need to do is be aware of your rights as a father. Here are some links that specialize in fathers rights
Also when you do get an attorney - which you will need - make sure they specialize in fathers rights as well.
MAke sure your children have a law guardian appointed to them - these are lawyers appointed by the courts ( for free) to represent the children in custody cases.