Marijuana use is not tolerated while serving in any of the services but each service does issue waivers for limited pre-enlistment use. Underage alcohol consumption can also be disqualifying but again waivers can be issued. The only way to know for sure if you will need a waiver will be to disclose use to your recruiter. Remember that there is no penalty or punishment in talking about your situations with your recruiter, so always check with him/her first!
Most services have zero tolerance for any drugs harder than marijuana. Examples include heroin, cocaine or ecstasy. You will have a drug test at the military entrance processing station (MEPS) so it's very important to disclose all use to your recruiter.