He and his wife wants to take my baby away from me

So I’m pregnant by a man I’ve been involved with for about 3 years. A man that lied and told me he was single come to find out he’s married. He told me that his wife now knows that the baby is due soon and they plan on taking me to court to get the baby. I am in school to become a registered nurse. I have my own apartment and I also have a job. I don’t do drugs, I do not drink, I do not hang out in the streets & I do not have a criminal background. Can they do this?