Riyad as-SalihinChapter 17Hadith 1077
Full Sharh — Riyad as-Salihin 1077
وعن أنس رضي الله عنه قال: قال لي رسول الله صلى الله عليه وسلم : "إياك والالتفات في الصلاة، فإن الالتفات في الصلاة هلكة، فإن كان لابد، ففي التطوع لا في الفريضة".((رواه الترمذي وقال حديث حسن صحيح)).
English Translation
Anas (May Allah be pleased with him) said:: The Messenger of Allah (ﷺ) said to me, "Beware of looking around in Salat (prayer), because random looks in Salat are a cause of destruction. If there should be no help from it, it is permissible in the voluntary and not in obligatory Salat.".
Source
Riyad as-Salihin(رياض الصالحين)
The Book of the Prohibited actions
Hadith Number
1077