The Prophet ﷺ said, "An adulterer, at the time he is committing illegal sexual intercourse is not a believer; and a person, at the time of drinking an alcoholic drink is not a believer; and a thief, at the time of stealing, is not a believer."
Ibn Shihab said: ʿAbdul Malik bin Abi Bakr bin ʿAbdur-Rahman bin Al- Harith bin Hisham told me that Abu Bakr used to narrate that narration to him on the authority of Abu Huraira. He used to add that Abu Bakr used to mention, besides the above cases, "And he who robs (takes illegally something by force) while the people are looking at him, is not a believer at the time he is robbing (taking).
إِنَّ النَّبِيَّ ﷺ قَالَ: «لاَ يَزْنِي الزَّانِي حِينَ يَزْنِي وَهْوَ مُؤْمِنٌ، وَلاَ يَشْرَبُ الْخَمْرَ حِينَ يَشْرَبُهَا وَهْوَ مُؤْمِنٌ، وَلاَ يَسْرِقُ السَّارِقُ حِينَ يَسْرِقُ وَهْوَ مُؤْمِنٌ۔»
قَالَ ابْنُ شِهَابٍ وَأَخْبَرَنِي عَبْدُ الْمَلِكِ بْنُ أَبِي بَكْرِ بْنِ عَبْدِ الرَّحْمَنِ بْنِ الْحَارِثِ بْنِ هِشَامٍ أَنَّ أَبَا بَكْرٍ كَانَ يُحَدِّثُهُ عَنْ أَبِي هُرَيْرَةَ ثُمَّ يَقُولُ كَانَ أَبُو بَكْرٍ يُلْحِقُ مَعَهُنَّ: وَلاَ يَنْتَهِبُ نُهْبَةً ذَاتَ شَرَفٍ يَرْفَعُ النَّاسُ إِلَيْهِ أَبْصَارَهُمْ فِيهَا حِينَ يَنْتَهِبُهَا وَهْوَ مُؤْمِنٌ