ENOfficial
‘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.
Source: sunnah.com
Other translations
Arabic
وَعَنْ عَبْدِ اللَّهِ بْنِ مَسْعُودٍ قَالَ: كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا أُتِيَ بِالسَّبْيِ أَعْطَى أَهْلَ الْبَيْتِ جَمِيعًا كَرَاهِيَةَ أَنْ يفرق بَينهم. رَوَاهُ ابْن مَاجَه
sunnah.com