Preventing Lightning in Minecraft
Solution 1:
The chances of lightning striking a person is very slim but if you wish for protection use any type of armor with fire protection or protection. Lightning also isn't as strong as people think, it usually only takes away two and a half hearts and lights you on fire. To prevent it from hitting the environment would take even more effort judging by the fact that it is about 60 mil blocks wide (1 minecraft world is about 60 mil blocks wide(-30mil - +30mil) Lightning creates fire where it strikes. The accompanying rain can usually put out fires before they spread. Overhangs can prevent rain from putting out lightning fires, allowing the fire to spread. The only time thunder will strike without rain is in a desert since it can't rain in the desert.
Solution 2:
Yes, and no. If you are underneath a block, then the lightning will hit the block instead of you. If there is open sky above you, then you cannot prevent lightning from hitting you. This (and spiders) are the reason a ceiling is essential in a house.
Keep in mind that lightning will create fire where it strikes. You can lessen the damage the fire gives you with the Fire Protection enchantment on armor, or you can negate it completely with a Potion of Fire Resistance.
This fire will burn down any wooden buildings you have (If it strikes the building/nearby the building). To counter this, you can build a house made of material other than wood or build an underground house. Some players build a second layer on their roof made of stone, so that lightning strikes from above will not be effective. However, lightning strikes that come from the side of the building will still burn down the house.
When lightning strikes a block, it may destroy that block (depending on the block resistance). To prevent this, you can build a second layer on your roff (the same method mentioned above). This will give your house extra protection against lightning strikes.
Lightning strikes are actually pretty rare, so all this would be extra protection, if you ask me.
Solution 3:
Lightning cannot strike underneath blocks, so a ceiling is the only real way to protect yourself. However, fire protection armour can help reduce the damage from the fire that the lightning starts.