my son is now 23 mos old & we experienced the same thing. what i realized is that he needs a transition time or warning time when an activity is about to end. just giving the warnings, "we're going to finish up and leave in five minutes" and another at one minute. then, when we're about to leave, we say "bye bye" to toys & friends. technically they don't understand time just yet, but my son will understand "soon" and "get ready to go" and it works pretty well. every once in a while we have to leave an activity he absolutely doesn't want to, so he'll still throw a fit, but not NEARLY as often anymore.
you may also want to note if he has them more when he's hungry, thirsty, etc. and just try to meet those needs before the meltdown occurs. it also helps to acknowledge his feelings, and maybe offer an alternative. (say, "i know you're angry/sad/disappointed we can't do x. that's okay. right now we can't do x. let's do y instead.") we've just entered a stage where my son needs to have a valid reason for stopping x, so you may want to offer that, too. ("not safe," "yucky," "not for babies" are our go-to's.)
your son is too young to be able to work through those powerful feelings on his own, so try to help him do that by validating his feelings and diverting attention or just breathing till he calms down. the girl i babysit (same age as my son) needs to be held during tantrums & calms down easily if that's done, whereas my son doesn't want to be touched when he's mad (like his mama). just keep trying until you find what works for you and your son. remember that you are his role model & teacher.
good luck!!