Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:3:20

So if they argue with you, say, "I have submitted myself to Allah ˹in Islam˺, and ˹so have˺ those who follow me." And say to those who were given the Scripture and ˹to˺ the unlearned, "Have you submitted yourselves?" And if they submit ˹in Islam˺, they are rightly guided; but if they turn away - then upon you is only the ˹duty of˺ notification. And Allah is Seeing of ˹His˺ servants.  

So if they, the disbelievers, dispute with you, O Muhammad (s), concerning religion, say, to them: ‘I have surrendered my countenance to God, ˹that is to say˺ I have submitted to Him, I, and whoever follows me’ (wajh, ‘countenance’, is chosen here because of its noble character, for the other ˹parts of the body˺ will just as soon ˹surrender once the countenance has˺); and say to those who have been given the Scripture, the Jews and the Christians, and to the uninstructed, the Arab idolaters: ‘Have you submitted?’, that is to say, ‘Submit!’ And so if they have submitted, they have been guided, from error, but if they turn their backs, to Islam, your duty is only to deliver, the Message; and God sees His servants, and so requites them for their deeds — this ˹statement˺ was ˹revealed˺ before the command to fight ˹them˺ had been revealed.
القرآن:٣:٢٠

فَإِنْ حَاجُّوكَ فَقُلْ أَسْلَمْتُ وَجْهِيَ لِلَّهِ وَمَنِ اتَّبَعَنِ ۗ وَقُلْ لِلَّذِينَ أُوتُوا الْكِتَابَ وَالْأُمِّيِّينَ أَأَسْلَمْتُمْ ۚ فَإِنْ أَسْلَمُوا فَقَدِ اهْتَدَوْا ۖ وَإِنْ تَوَلَّوْا فَإِنَّمَا عَلَيْكَ الْبَلَاغُ ۗ وَاللَّهُ بَصِيرٌ بِالْعِبَادِ  

{فإن حاجوك} خاصمك الكفار يا محمد في الدين {فقل} لهم {أسلمت وجهي لله} أنقدت له أنا {ومن اتبعن} وخص الوجه بالذكر لشرفه فغيره أولى {وقل للذين أوتوا الكتاب} اليهود والنصارى و {الأميين} مشركي العرب {أأسلمتم} أي أسلموا {فإن أسلموا فقد اهتدوا} من الضلال {وإن تولوا} عن الإسلام {فإنما عليك البلاغ} أي التبليغ للرسالة {والله بصير بالعباد} فيجازيهم بأعمالهم وهذا قبل الأمر بالقتال