Child born as a hermaphrodite
Question: If a child is born as a hermaphrodite, what sex should that child follow?
Answer: If the child urinates from the male organ, then the sex would be that of a boy, and if the child urinates from the female organ, then the sex would be that of a girl. Further to this, while the child is growing, one would look to see the signs of puberty. If the child at this stage experiences the menstrual cycle, then it is clear that the child is a girl. If not, the ruling would be that of a boy. (Al Fiqhul Islami Wa Adilatihi Vol.10 pg 7900)
And Allah knows best.
Mufti Waseem Khan