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:60:8

Allah does not forbid you from those who do not fight you because of religion and do not expel you from your homes - from being righteous toward them and acting justly toward them. Indeed, Allah loves those who act justly.  

God does not forbid you in regard to those who did not wage war against you, from among the disbelievers, on account of religion and did not expel you from your homes, that you should treat them kindly (an tabarrūhum is an inclusive substitution for alladhīna, ‘those who’) and deal with them justly: this was ˹revealed˺ before the command to struggle against them. Assuredly God loves the just.
القرآن:٦٠:٨

لَا يَنْهَاكُمُ اللَّهُ عَنِ الَّذِينَ لَمْ يُقَاتِلُوكُمْ فِي الدِّينِ وَلَمْ يُخْرِجُوكُمْ مِنْ دِيَارِكُمْ أَنْ تَبَرُّوهُمْ وَتُقْسِطُوا إِلَيْهِمْ ۚ إِنَّ اللَّهَ يُحِبُّ الْمُقْسِطِينَ  

{لا ينهاكم الله عن الذين لم يقاتلوكم} من الكفار {في الدين ولم يخرجوكم من دياركم أن تبروهم} بدل اشتمال من الذين {وتقسطوا} تفضوا {إليهم} بالقسط، أي بالعدل وهذا قبل الأمر بجهادهم {إن الله يحب المقسطين} بالعادلين.