Answer
Looking around during prayer can either be disliked, permissible, or invalidating to the prayer: The disliked looking around is to glance to the right and left while turning one's neck. The permissible looking around is to glance with the corners of one's eyes without turning the neck. The invalidating looking around is to turn one's chest away from the Qibla. This is evidenced by a narration from Ibn Abbas, may Allah be pleased with him, that "The Messenger of Allah, peace be upon him, would glance right and left in prayer without turning his neck behind his back," as found in Al-Mu'jam Al-Kabir 11: 223, Sunan Al-Tirmidhi 2: 482, Sunan Al-Daraqutni 2: 83, and others. Ibn Al-Qattan authenticated it. See: I'laa Al-Sunan 5: 152. And from Aisha, may Allah be pleased with her, who said: "I asked the Messenger of Allah, peace be upon him, about looking around in prayer, and he said: It is a theft that the devil steals from the prayer of the servant," as found in Sahih Al-Bukhari 1: 261, and Sunan Al-Tirmidhi 2: 484. See: Al-Durr Al-Mukhtar 1: 433.