All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The stability of marital life and the spread of affection, love and intimacy are all among the noble objectives for which Islam has legislated marriage.
So, both the husband and the wife should endeavor to fulfill such objectives and avoid anything that could affect their achievement.
So, we advise you both to be patient and weigh the matter in a reasonable and rational way. You should avoid decision based on simple emotions and think about the consequences. Divorce is not always a solution; it is rather adding more complications to a situation that is already difficult. Divorce results in splitting a family and spoiling the children. So, make the interest of your children a priority.
Now, if there is no other way except divorce, then Islam initially gives the right of custody and fostering of the children to the mother.
However, the Muslim jurist have different opinions in regard to the age at which the right of the mother to foster the children expires. The most preponderant opinion is that when the children reach the age where they become able to distinguish and choose, they are given the chance to choose the parent they prefer to stay with.
Nevertheless, if it is feared that their religion might get affected if they live with their father, then they should stay with their mother as long as necessary, provided there is no impediment to their staying with her.
Since in most cases such issues lead to dissension and dispute, we suggest that you take this matter to Islamic courts or Centers in your area to study the matter and give you the appropriate opinion and best solution.
Allaah Knows best.