Removing modifier error
Assuming John is the person who is going home, you can so phrase your sentence that it will convey what you mean it to, without ambiguity.
- When he was on his way home, John saw a huge man.
- As John was going home, he saw a huge man.
- John was on his way home when he saw a huge man.