Custody

Hii My sister was married 13 yrs ago after 2 yrs of her marrige she came to know that her husband is suffering from infertility and so they can not have child. She started getting depressed at the same time the husband got job in dubai and because she was alone she had a affair .she gave birth to a baby girl in 2017 feb no one knew that the child does not belong to her husband but later after 3 months we came to know the reality ,they both got divorced she got married and the husband went back to dubai and the child was left with us that is grand parents and me (aunty) .the child was given the husbands name as father because he was willing to give his name and the birth certificate had it.Now he is getting married and has told his would be wife and in-laws that he has a daughter just to hide his infertility problem and tries to prove that the child belongs to him. Can he get the custody? Do we have the right to stop him from taking her away from us? Does he have any legal rights ? Can we claim her? We have a notary doen from both my sister and her x husband that till 18 she will stay with my mother i.e her grand mother.