الحمد لله وحده، والصلاة والسلام على من لا نبي بعده، وعلى آله وصحبه، أما بعد
Shaikh Saalih bin Fawzaan Al-Fawzaan (hafidhahullaah) said during his explanation of the text of Mandhoomah Al-Adaab:
“These are the instances in which giving the salaam is disliked:
The first instance: it is disliked to give salaam to the one who is speaking, since he is busy in conversation with other than himself.
The second instance: ‘with regards to the one who is busy with dhikr (remembrance of Allaah)’ – by way of tasbeeh (saying: subhaanallaah) and tahleel (saying: laa ilaaha illallaah) and in the recital of the Qur’aan.
The third instance: with regards to the one who is pre-occupied with the hadeeth from the sayings of Muhammad (sallallaahu ‘alaihi wa sallam).
The fourth instance: giving salaam to the khateeb except during the Friday sermon; since it is forbidden to speak during the Friday sermon; and so giving salaam to the khateeb and to those in attendance is impermissible.
The fifth instance: ‘the one delivering a lecture’ – the one who is delivering a lesson relating to the Qur’aan or relating to hadeeth or Fiqh or in grammar – do not give salaam to him. Some people; when they come to a gathering and the lesson is in progress; he will give the salaam and raise his voice, this is disliked because this distracts the teacher just as it distracts those who are sat listening and so they turn their attention to him.
The sixth instance: ‘those who are researching in the sciences’ – whoever is researching an issue from the issues of knowledge then do not extend the salaam towards him and thus disrupt his research; this is not legislated.
The seventh instance: ‘one who is delivering an admonition’ – whoever is admonishing the people; then do not give the salaam if you approach, rather sit and listen to the admonition. Do not extend the salaam; because you will distract the admonisher as well as distract those that are listening.
The eighth instance: the one who is reiterating/revising in (an issue of) Fiqh; and he is the one who is revising/studying Fiqh.
The ninth instance: the muadhin; if he is giving the adhaan then do not extend the salaam towards him whilst he is giving the adhaan; since you will interrupt him from the adhaan.
The tenth instance: ‘the one who is praying’ – if you arrive and someone is praying; do not extend the salaam towards him until he has concluded his prayer. It has been reported that one of the companions gave the Prophet (sallallaahu ‘alaihi wa sallam) the salaam whilst he was in prayer and so he responded to him with an ishaarah (indication). Therefore is someone gives you salaam whilst you are praying then you should respond to him with an ishaarah.
The eleventh instance: ‘the one who is observing purification’ – the one who is performing the wudhu then do not extend the salaam towards him until he has concluded his wudhu. As for the one who is bathing for other than the purpose of worship; in order to keep cool or to clean himself then there is nothing preventing you from giving him salaam.
The twelfth instance: likewise it is not legislated to give the salaam to the one who is preoccupied with eating.
The thirteenth instance: ‘to the one who is defecating’ – this is more severe; and he is the one who is urinating or defecating – do not give him salaam whilst he is relieving himself. Since it is disliked for the one who is defecating or urinating that he should speak in this situation; so do not give him salaam.
The fourteenth instance: ‘the one who is fighting the enemy in a war’ – the last type is the Mujaahid who is in the instance of fighting; you should not extend salaam to the one who is fighting because he is busied from you in fighting the enemies of Allaah.”
(Taken from: Ithaaf At-Tullaab bi-Sharh Mandhoomah Al-Adaab p.219-221)
 As reported by At-Tirmidhee in: the book of prayer, chapter: what has been stated regarding the indication in the prayer (no.367).