All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The basic principle is that if this man has divorced his wife, the custody of the child is given to the mother so long as she does not remarry and as long as she meets the conditions of the custody (i.e. there is no religious impediment that prevents her from taking custody, like being immoral or the like). If the mother is not qualified to take custody, then the custody of the child is granted to the next worthier female relative according to the order underlined by the jurists. The father may be given custody according to certain conditions underlined by scholars. They are explained in fatwas 84618 and 86891.
These two fatwas also mention the different scholarly opinions regarding the age of custody. You should also know that the scholars held different views regarding the custody of the child when the parents live in two different countries.
The circumstances in the situation that you inquire about make issuing a fatwa in this regard of no real benefit; therefore, we advise that man to solve his problem with the mother of his child in a friendly manner. As for the divorce, it is in his hands. If he issues divorce, it takes effect. If the wife claims that the divorce did not take place and demanded her rights as a wife during that period, then he has to prove the divorce; otherwise, her legal rights as his wife during this period are established and binding on him. This emphasizes the need to refer the case to the Muslim judge as well as the fact that issuing a fatwa in this regard is futile.
Allah knows best.