Custody of my 5 year old son

I am married for 9 years now. To start with, I started facing issues immediately after 2 months of marriage. My mil n sil would not allow us to make any physical contact. They turned my husband in their favour and he said he had exams and didn't wish to divert. After that we were allowed to be together at night with minimal privacy. Being a very small living space we had to sleep in the kitchen and my family members would walk in any moment.. because of which we have severe verbal fights. Even in those circumstances I happened to conceive and other family related issues arises because of which we had to move out on rent.. I then started working.. Since I wasn't very happy with the physical attention I got. I happened to contact one of my friends before marriage and during a telephonic conversation we had an adult chat. And during the same time I had contacted another friend who was known to me before marriage. And we had an adult chat on WhatsApp he was describing an incident which happened before my marriage. I have not met any of these guys in person. I also happened to visit one of the porn sites and had shared my nudes. As I was initially not getting the desired physical attention also I had lost my interest in making any physical contact with my husband. During a device change my husband retrieved all the above call recordings, chat transcript and the images I shared on the porn site/WhatsApp. And he started mentally harassing me and blackmailing me. Saying that he will share it with my family members and will defame me. I remained quiet for the fear of my parents health. He kept harassing me on the same issue for almost an year. N had blackmailed me with those things. Off late I met my ex boyfriend. Which was just a casual meeting, and some very professional and sober email conversation. By this time because of his blackmailing and harassment I took my kid and moved to my mother's place. And took my kids admission here And later on I met a guy on social media and after having a WhatsApp and telephonic conversation (including intimate talks) we decided to meet, with no intention of being physical just a casual meet. We met in a lounge we had a drink 60ml vodka. And took a cab. While we were in a cab we hugged and kissed eachother. My husband has now found out about this guy and the chats and the incident that we kissed in the cab.. and he has been threatening me since then that he will take my kid away from me as he has also got the cctv footage of the lounge and he has threatened me he will make a big file and defame me. He had harassed me to the extent that he made me write all this on a normal paper and sign it.. I don't wish to stay with him but want my kids custody as well. I have no intention of getting remarried and can take care of myself and my kid. He has cut all my contacts had taken away my sim cards. And doesn't allow me to talk with anyone.. he wants me to stay with him but I don't wish to. HELP