There are two brachos for lightning and thunder: We make the brachah, “Baruch Ata Hashem Elokeinu Melech Ha’Olam Oseh Ma’asei Bereishis,” or we may make the brachah, “Baruch Ata Hashem Elokeinu Melech Ha’Olam Shekocho U’gvuraso Molei Olam”. If we see lightning and hear thunder simultaneously, only one brachah is said; either one is acceptable. If we see lightning first and then hear thunder, or the other way around, we make two brachos. Strictly speaking, the same brachah may be said twice. However, the common practice is to say separate brachos for lightning and for thunder: Oseh Ma’asei Bereishis is said for lightning, since it reminds us of the greatness of He Who created the world, and Shekocho U’gvuroso Molei Olam is said for thunder, because thunder is reminiscent of the koach, strength, and gevurah, power, of Hashem Who fills the world. The reason we say different brachos for lightning and thunder is in order to praise Hashem in various ways, but saying different brachos is not obligatory. The brachos must be recited within toch ke’dei dibbur (the amount of time it takes to say the words sholom alecha rabbee, i.e. within a second or two) of seeing lightning or hearing thunder. If one did not recite the brachah within a second or two, he should recite the brachah without Shem u’Malchus, without the phrase, “Hashem Elokeinu Melech Ha’olam,” or wait to make the brachah until he sees another bolt of lightning or hears another clap of thunder. These brachos are said only once per storm. If in the interim the clouds separate and new clouds form creating lightning and thunder, it is halachically considered a new storm and the brachos are repeated. The brachah on lightning is said only on lightning that is caused by a thunderstorm, and not “heat lightning”, a lighting usually accompanied by a warm weather and popularly attributed to heat.
https://asktherav.com/article-174-blessing-on-lighting-and-thunder/