Last name

I have a question. My boyfriend is married. They are not longer together, they are separate many years ago but he never did the divorce. Since we are together I told him to do it! If not I do not wan to continue with him. We I found out I was pregnant I told him to do it before I have my baby.  He didnt. I am mad, angry sad etc... But I do not want to think on that now because I know my emotions could affect my little girl. My question is, if we are not legally married but he is... He will be able to recognize and give his last name to our baby???? It does not matter that he is married with another person??? Help please!!! If not, how can get information about this??