Whenever the Prophet ﷺ dispatched a military expedition, he would say, "If you see a mosque or hear a caller to prayer, do not kill anyone."Ibn Isam reported from his father, "The Messenger of Allah ﷺ sent us out on an expedition."
حدثنا سفيان قال ذكره عبد الملك بن نوفل بن مساحق قال سفيان وجده بدري
كان النبي ﷺ إذا بعث السرية يقول إذا رأيتم مسجدا أو سمعتم مناديا فلا تقتلوا أحدا قال ابن عصام عن أبيه بعثنا رسول الله ﷺ في سرية
Its chain is daif due to the obscurity of Ibn Isam, as the scholars of criticism have stated. As for Abdul-Malik bin Nawfal bin Musahiq Amiri Qurashi, they accepted him. The hadith was narrated by Tirmidhi (4/120, no. 549), who said it is gharib. The hadith is corroborated by the report that the Messenger of Allah ﷺ used to wait for Fajr before launching a raid, and if he heard a call to prayer, he would refrain from attacking. It is a long hadith. See 13073.