Custody?

Does anyone knows how custody works for parents that aren’t married of a 1.5 year old? I do everything with my son take care of him, feed him, bathe him, change him. My boyfriend hasn’t done anything and I am not sure he is even capable of watching him by his self. Also he is rarely off about 1 or 2 days every two weeks. He works from 6:00-5pm and he gets home tired and sleeps really early. How would custody work here? I’m very unhappy in my relationship and want to leave but I’m just scared he’s going to get some custody and not take care of my son right. I also don’t trust him i have gotten mad at him for hitting my son when my son hits him and also he has put his finger in his beer bottle to have my son taste it from his finger. I just feel like he isn’t fit to be a father let alone on his own. TIA