Who is he in the following sentence?

John thanked Bill because he had needed help.
John