4:94
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوٓا۟ إِذَا ضَرَبْتُمْ فِى سَبِيلِ ٱللَّهِ فَتَبَيَّنُوا۟ وَلَا تَقُولُوا۟ لِمَنْ أَلْقَىٰٓ إِلَيْكُمُ ٱلسَّلَٰمَ لَسْتَ مُؤْمِنًۭا تَبْتَغُونَ عَرَضَ ٱلْحَيَوٰةِ ٱلدُّنْيَا فَعِندَ ٱللَّهِ مَغَانِمُ كَثِيرَةٌۭ ۚ كَذَٰلِكَ كُنتُم مِّن قَبْلُ فَمَنَّ ٱللَّهُ عَلَيْكُمْ فَتَبَيَّنُوٓا۟ ۚ إِنَّ ٱللَّهَ كَانَ بِمَا تَعْمَلُونَ خَبِيرًۭا
O you who have believed, when you go forth [to fight] in the cause of Allah, investigate; and do not say to one who gives you [a greeting of] peace "You are not a believer," aspiring for the goods of worldly life; for with Allah are many acquisitions. You [yourselves] were like that before; then Allah conferred His favor upon you, so investigate. Indeed Allah is ever, with what you do, Acquainted.
Translation · Saheeh International
Tafsir
Ibn Kathīr (abridged)
Greeting with the Salam is a Sign of Islam
Imam Ahmad recorded that `Ikrimah said that Ibn `Abbas said, "A man from Bani Sulaym, who was tending a flock of sheep, passed by some of the Companions of the Prophet and said Salam to them. They said (to each other), `He only said Salam to protect himself from us.' Then they attacked him and killed him. They brought his sheep to the Prophet , and this Ayah was revealed,
يَـأَيُّهَا الَّذِينَ ءَامَنُواْ
(O you who believe!), until the end of the Ayah." At-Tirmidhi recorded this in his (chapter on) Tafsir, and said, "This Hadith is Hasan, and it is also reported from Usamah bin Zayd." Al-Hakim also recorded it and said, "Its chain is Sahih, but they did not collect it." Al-Bukhari recorded that Ibn `Abbas commented;
وَلاَ تَقُولُواْ لِمَنْ أَلْقَى إِلَيْكُمُ السَّلَـمَ لَسْتَ مُؤْمِناً
(and say not to anyone who greets you: "You are not a believer;"), "A man was tending his sheep and the Muslims caught up with him. He said, `As-Salamu `Alaykum.' However, they killed him and took his sheep. Allah revealed the Ayah;