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, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If the situation is as you mentioned, that your wife is not good, and you fear that she will corrupt your child’s morals if she is given custody, and you believe that in all likelihood you will not get the custody of the child unless you are naturalized into that country, then we believe that you are not sinful – Allaah willing – if you gain citizenship there; as this is a considerable Islamic benefit. For more benefit, please refer to Fataawa 87140 and 82552.
After this, you should endeavor to migrate to a Muslim country to reside there in order to be able to educate your child in the Islamic beliefs and morals. Residing in a non-Muslim country is very dangerous and involves negative consequences especially on the upbringing of children, so it is not permissible to reside there without necessity or a dire need. Please refer to Fataawa 179175 and 86405.
Finally, it should be noted that the parent who has the custody of the child is not permitted to prevent the other parent from seeing the child, because preventing this consists in injustice and abuse.
Allaah Knows best.