I had similar difficulties with my DS, same age, last year. It actually served as a wake up call for me because I realised that I wasn't actually taking that much interest in his interests or his school work, so I did something about that.
Also after the initial rant and taking his phone, laptop etc off him which was a waste of time not the way to win coooperation from a stroppy teen, I decided that I'd be calm and not create a situation where his friends and smoking and drinking and drugs seemed taboo and thus exciting. I simply told him that I didn't want him being involved with such things but I wasn't completely stupid and realised that kids do this sort of stuff. No ranting, just a weary acceptance.
He still goes out with his undesirable stupid friends, and I'd be surprised if there wasn't the occasional cigarette, or whatever, passed around. However he now accepts that he needs to come home at a reasonable time and let me know roughly where he is.
I was also called into school and felt like a rubbish parent but used this to request support from teachers to keep an eye on my DS and offer him more support in areas he seemed to be struggling. This was much better than colluding with them and making my DS feel rubbish about himself.
Essentially my DS, and I imagine yours too, is just trying a few things out and pushing the boundaries. IMO they need to know we are interested in them and love them despite them messing up now and again.
So maybe forget the shouting, give him his phone back, show you're interested in him and get the school on board in trying to support him through this difficult period. Good luck.