
It is important that your pet can find a safe place. If he wants to crawl under the bed, let him do so. Even if you mean well, don't cuddle and stroke him. Otherwise he will learn that his panic is rewarded and it will get worse in the future. Stay calm yourself to show your dog that there is no need to be afraid during thunderstorms.
If your dog has severe panic attacks and may even break things during thunderstorms, you can also ask your vet for a tranquilizer. Incidentally, this is also a good idea if there is a big bang in your neighborhood on New Year's Eve. Many dogs get anxious then too.