Sunan an-Nasa'i #4872
The Book of Cutting off the Hand of the Thief 46:3
It was narrated that Abu Hurairah said:
"No one who commits Zina is a believer at the moment when he is committing Zina; no one who steals is a believer at the moment when he is stealing; no one who drinks wine is a believer at the moment when he is drinking it." - And he mentioned a fourth but I (the narrator) have forgotten it - "When he does that the yoke of Islam is shed from his neck, but if he repents, Allah accepts his repentance."