Child custody

Me and my husband are married for 6.5 years now. Both are doctors. I had to stay away from my husband during speciality medical training and my daughter (5.5 years) also stayed with me from birth. He rarely came to meet us and does not send money for anything(I am self sufficient and do not ask money unless there is a necessity). After completion of medical training, when i came to my home town, he was still not willing to come and stay with us. On suspicion, I checked his mobile phone and saw pictures where he is naked waist above with a girl in night dress. I checked the sms messages and could clearly see physical relationship going on and photos of genitals shared between either of them and sharing details of intercourse they had. After some inquiries i came to know that the girl is married with two kids and is an agricultural officer with the state government. When I confronted my husband he begged forgiveness but continued the relationship with her (I have proof of sms messages taken from his mobile where he simultaneously speaks to both of us saying he wants to be with us). Now he does not send documents or shares details for filling in school applications. After I asked him to give legal custody not divorce, he is now threatening me that he will file for divorce and child custody. My daughter is 5.5 years, completely under my care, goes to school in my city and I pay all her fees from 2.5 years. He has not given us any money and runs his own hospital. What is my rights regarding child custody here.