Need help ex problems

Hey I have this guy he's the unborn baby's dad and he's threating to get custody of the baby if I get with another guy and have that guy raise the baby as his and not the baby's dad.....can they do that and how dose this custody thang work.....I'm only about 5 weeks or so.....please help any one please help I need help real bad