As soon as you hear thunder, stop what you are doing and get inside a substantial building or a hard-topped metal vehicle (don’t lean on the doors). If you can hear thunder, lightning is probably close enough to potentially harm you. It can strike as far as 10 miles from any rain.
If taking shelter in a building or car just isn’t an option, the NWS advises avoiding open areas and being the tallest object in the area. Lightning tends to strike the tallest objects. While it’s not attracted to metal, it easily travels through metal objects such as wires and pipes. Stay away from isolated tall trees, utility poles or towers.
Don’t crouch or lie down, but keep moving toward a safe place.
If you’re in a group, spread out. The NWS says that while that could increase the chances that someone will be struck, it also can help prevent multiple casualties and increase the chance someone in the group is there to offer first aid.