During a thunderstorm, lightning will strike tall objects, if it happens to strike the tree you're seeking shelter under, the electricity from lightning, will encompass you also. Not good.
Because during a thunder storm lighting may strike a trees, which would then get on you too - so it is advisable not to take shelter under trees during storms. But you can take shelter under small trees which are covered by the big ones:)