(8) The Book of the Masjids
كتاب المساجد
(29) Chapter: Sleeping In The Masjid
(29) باب النَّوْمِ فِي الْمَسْجِدِ
Sunan an-Nasa'i 722 
It was narrated from Ibn 'Umar, that when he was young and single, with no family, at the time of the Messenger of Allah (ﷺ), he used to sleep in the Masjid of the Prophet (ﷺ).
أَخْبَرَنَا عُبَيْدُ اللَّهِ بْنُ سَعِيدٍ، قَالَ حَدَّثَنَا يَحْيَى، عَنْ عُبَيْدِ اللَّهِ، قَالَ أَخْبَرَنِي نَافِعٌ، عَنِ ابْنِ عُمَرَ، أَنَّهُ كَانَ يَنَامُ وَهُوَ شَابٌّ عَزْبٌ لاَ أَهْلَ لَهُ عَلَى عَهْدِ رَسُولِ اللَّهِ صلى الله عليه وسلم فِي مَسْجِدِ النَّبِيِّ صلى الله عليه وسلم ‏.‏
Grade :  Sahih (Darussalam)
Reference : Sunan an-Nasa'i 722
In-book reference : Book 8, Hadith 35
English translation : Vol. 1, Book 8, Hadith 723