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:51:35

So We brought out whoever was in the cities of the believers.  

So We brought forth those in them, that is, ˹in˺ the towns of the people of Lot, who were believers, in order to destroy the disbelievers;
القرآن:٥١:٣٥

فَأَخْرَجْنَا مَنْ كَانَ فِيهَا مِنَ الْمُؤْمِنِينَ  

{فأخرجنا من كان فيها} أي قرى قوم لوط {من المؤمنين} لإهلاك الكافرين.