Bulugh al-Maram, Book 11, Hadith 1345 (English)

Abu Hurairah (RAA) narrated that The Messenger of Allah said: “Whichever town you take peacefully (they surrendered without, fighting), and stay therein, you have a share in it (in whatever is obtained from it); and whichever town disobeys Allah and His Messenger, a fifth of (its booty) goes to Allah and His Messenger and what remains is yours. Related by Muslim.

وَعَنْ أَبِي هُرَيْرَةَ ‏- رضى الله عنه ‏- أَنَّ رَسُولَ اَللَّهِ ‏- صلى الله عليه وسلم ‏-قَالَ: { "أَيُّمَا قَرْيَةٍ أَتَيْتُمُوهَا, فَأَقَمْتُمْ فِيهَا, فَسَهْمُكُمْ فِيهَا, وَأَيُّمَا قَرْيَةٍ عَصَتْ اَللَّهَ وَرَسُولَهُ, فَإِنْ خُمُسَهَا لِلَّهِ وَرَسُولِهِ, ثُمَّ هِيَ لَكُمْ" } رَوَاهُ مُسْلِمٌ.‏ 1‏.‏ ‏1 ‏- صحيح رواه مسلم ( 1756 )‏.‏

sunnah.com

also referenced under: Book 11, Hadith 1319 (In-Book)