Mishkat al-Masabih · Book 13 · Hadith 3373
وَعَنْ عَبْدِ اللَّهِ بْنِ مَسْعُودٍ قَالَ: كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا أُتِيَ بِالسَّبْيِ أَعْطَى أَهْلَ الْبَيْتِ جَمِيعًا كَرَاهِيَةَ أَنْ يفرق بَينهم. رَوَاهُ ابْن مَاجَه
‘Abdallah b. Mas'ud said that when captives were brought to the Prophet (ﷺ) he gave families together through dislike of separating them. Ibn Majah transmitted it.