The boy lent his friend a pencil because the teacher told him to share.

Who is him referring to in this sentence?
The boy