Saying "Hello", he walked out of the classroom and went home
"Hello" is said by him at the time he walked into his home
"Hello" is used at the time of greeting instead of leaving
"Hello" is said by him to please his classmates in the classroom