Unfortunately many dogs are terrified of thunderstorms. My Ciara is but she just cowers and tries to become my third kidney. If we're not home she just cowers in a corner. There is not much you can do if you don't know a storm is coming while you're out. There are strong, better crates that you can buy that would keep your pup safer and are more or less indestructible. You can also medicate if you know ahead of time - talk to your vet first. Definitely do not leave them outside. That's how so many dogs go missing when they find a way to run away during storms and especially fireworks. Besides how would you feel if you were afraid of the dark and someone left you in a dark place and went out! Leaving your dog outside is the equivalent to that.
If you're home you can work on desensitization. Make sure you are NOT giving her/him (sorry I forgot and am on my phone and can't look lol) more attention and cuddles when she/he acts scared as that only reinforces their behavior. When the storms do hit, do something with him/her that they enjoy. Ciara was trained to do bite work (for fun since my hubs used to train corrections k9's) and she loves it so when a storm hits, we take her outside and do bite work. For her it's just a way to work out her anxiety but she's 9. For you, if your pup learns to associate fun things with those booms then it may, eventually, desensitize them so they are no longer afraid/fearful. Unfortunately since storms don't occur all the time, it's going to take a lot of time, effort, consistency and patience. That's why a lot of times desensitization training doesn't always work with storms. There is not often enough positive association training.
You can also try a thunder shirt. Some people have success with them though I've never tried them.
Good luck, thugs like this are trying for you and your pooch.