Give him a CHOICE, like this: "If you want to cry, you can go to your room. Or, if you can take a deep breath and calm yourself down, then you can stay here and play with your toy."
If you know in advance that he's going to have a problem, then you can tell him what to expect BEFORE he throws a fit, like this: "We're going in the store, but I'm not going to buy you a toy today. I expect you to have good behavior and to help me get the things on my list. Let's see how many minutes it takes us to get everything."
If he wants to get his way, that means he is old enough to have some control. LET HIM CONTROL SOME THINGS that matter to him. Can he choose what clothes to wear? Can he sometimes decide what you'll have for supper? Can he sometimes choose what you'll watch on TV?
Sometimes, when his behavior is good, let him have his way. Let him know you are impressed when he is able to calm himself down. REWARD him and CONGRATULATE him for good behavior!