Ruling on greeting a non-Muslim teacher
Question

Is it permissible to greet a non-Muslim teacher in the classroom or outside?
Praise be to Allah.It was narrated that the Prophet (peace and blessings of Allah be upon him) said: “Do not initiate the greeting to the Jews and Christians.” (Narrated by Muslim, Kitab al-Salam). The Jews used to pass by the Prophet (peace and blessings of Allah be upon him) and say “Al-saam ‘alaykum” meaning death. So the Prophet (peace and blessings of Allah be upon him) told us to say “Wa ‘alaykum (and also to you).” (Narrated by al-Bukhaari, Kitab al-Adab; Muslim, Kitaab al-Salam). 
So you should not initiate the greeting, but if he greets you and initiates the greeting, then say, “Wa ‘alaykum.” But Ibn al-Qayyim (may Allah have mercy on him) mentioned in Ahkaam Ahl al-Dhimmah that if we know for sure that a kaafir has said “Al-salamu ‘alaykum,” then we may say, “Wa ‘alaykum al-salam.”