If you cannot decide amicably who gets custody then the court will decide and they take into account first and above all the interests of the children. The mother usually gets custody but if the children are about ten and can speak for themselves if they wish to live with the father then it is likely that is where they will go.
So long as your health and the health of your children are not being threatened, it is advisable not to leave or move out of the family home until the divorce terms have been agreed upon. When you move out, leaving your children with your husband, the courts have a tendency to see this as abandonment of the children. However, if your husband is unfit to raise the children (abusive, neglectful, history of drug use or crime) you may have a case for taking the children with you. In general, a divorce court will award custody to the parent best able to provide for the best interests of the child or children. Your best course of action is to seek out a reputable family law attorney who can give you proper advice tailored to your family's specific situation.
It all depends on what reason you left your husband. . . . . . Did he beat the child and you? Was he neglectful of the child? There are a lot of other issues involved. See see