In some states it's mandatory that you have to go through mediation first but you don't have to agree to anything you don't want to. If neither of you can agree on any type of parenting plan, it will be submitted to a judge and he/she will decide.
You may ask for sole custody if you wish and if you can prove his drug use, etc. you may be able to get supervised visitation until he shows improvement in his life, meaning no drugs, etc. I'm not saying you'll get it, but you can ask.
Go to a search engine and look around for factors determined in custody hearings, and try to go to your state's legislative website and look up the laws for your state in determining the factors for custody there.
If the judge does say something about you picking him, which I've never heard any judge say or ask it cuz most of them don't care and don't want to be there anyway, I'd tell them, that people change, that is a fact of life. Also people do have skeletons in their closets or don't show their true colors for a long time. Usually when you date you're on your good behavior to impress the other person anyway. Sometimes we find out too late what the person is really like. Sometimes, it's not til a few kids and 10 yrs later, you look at them and wonder who they are or who you are and why you are with them. Sometimes we never find out their secrets. That's life and personally, I think it is naive to think otherwise. People only show you what they want you to see and unless you hire a private detective, run an application, drug and medical history on everyone you date, which actually is a pretty good idea but not realistic. I'm sure a lot of us wish we could invent a time machine and go back and do things over.