Even when they are inside, they can be killed by lightning while their buddies outside are unharmed.
That is how I lost the gelding in my signature - he was standing in his stall (wooden shed-row), full rubber mats on concrete. There was a lightning rod affixed to the structure right next to the barn. I still don’t understand how it happened or why he was the only one killed. This was the big storm in Aiken, SC in 2012 that also killed several other horses across the county.
For a while I looked for ways to “lightning proof” and really… there weren’t any. Structurally, everything was done right in this barn… my horse just was in the wrong place, at the wrong time.
At the risk of sounding blasé, I think there is very little you can do if the structure your horses are housed in is struck beyond hope that they are in the right spot at the right time. It really is a crapshoot.