I guess you need to develop ways to desensitize him. So you would need to be able to control a noise / sound he doesn't like.

Start by having the sound in the distance. When the sound goes off, he gets a treat. do that repeatedly over time.

Next, you have 2 options. Have the sound repeat and give him a treat each time, OR move the sound closer and treat. I would only work on one change at a time.

You want him to start associaitng that noise with something good, not something scary. When it thunders, don't hug him and console him, as this just reaffirms to him that there IS something to worry about. You have to go about normal activities (not easy!) I am sure others will have more info for you.

PS at least he is running HOME, not running in a mad panic to goodness kows WHERE, just anywhere away from the noise! That is a good thing, he feels safe at home. You will need a "safe" base when retraining him.