كتاب المقدمات
The Book of Miscellany
(38)
Chapter: Urging one's kith and kin to Obey Allah and refrain from evils
(38)
- باب وجوب أمر أهله وأولاده المميزين وسائر من في رعيته بطاعة الله تعالى، ونهيهم عن المخالفة وتأديبهم، ومنعهم من ارتكاب منهي عنه
Riyad as-Salihin 301
'Amr bin Shu'aib reported on his father's authority that his grandfather (May Allah be pleased with him) said:
Messenger of Allah (ﷺ) said, "Command your children to perform Salat (prayer) when they are seven years old, and beat them for (not offering) it when they are ten, and do not let (boys and girls) sleep together".

[Abu Dawud, who categorized it as Hadith Hasan with a Hasan Chain].

وعن عمرو بن شعيب، عن أبيه، عن جده رضي الله عنه قال‏:‏ قال رسول الله صلى الله عليه وسلم ‏:‏ ‏ "‏ مروا أولادكم بالصلاة وهم أبناء سبع سنين، واضربوهم عليها، وهم أبناء عشر، وفرقوا بينهم في المضاجع‏"‏ ‏(‏‏(‏حديث حسن رواه أبو داود بإسناد حسن‏)‏‏)‏‏.‏
Reference : Riyad as-Salihin 301
In-book reference : Introduction, Hadith 301