Just like the electricity flowing through the electrical wires in our homes the lightning is also electricity which seeks the best path to the ground.
So when the lightning gets near the ground to strike it will seek the person out and strike their body so that the lightning charge can get to the ground.
Lightning doesn't usually strike the ground directly because it usually needs something such as a metal pole, ground wire etc to get to the ground.
So if you're near the lightning the lightning can strike you and then go to the ground.
When a person is directly struck by lightning a portion of the current from the lightning strike moves along and just over the skin surface called flash over and a portion of the current moves through the body.
This usually occurs through the cardiovascular and/or nervous systems.