Full Sharh — Riyad as-Salihin 243
وعن أبي موسي رضي الله عنه أن رسول الله صلى الله عليه وسلم قال: إذا مات ولد العبد، قال الله تعالي لملائكته: قبضتم ولد عبدي، فيقولون: نعم، فيقول: قبضتم ثمرة فؤاده، فيقولون: نعم. فيقول: ماذا قال عبدي، فيقولون: حمدك واسترجع، فيقول الله تعالى: ابنوا لعبدي بيتاً في الجنة، وسموه بيت الحمد" ((رواه الترمذي وقال: حديث حسن)).
English Translation
Abu Musa Al-Ash'ari (May Allah be pleased with him) reported:: The Messenger of Allah (ﷺ) said, "When a man's child dies, Allah, the Exalted, asks His angels, 'Have you taken out the life of the child of My slave?' and they reply in the affirmative. He (SWT) then asks, 'Have you taken the fruit of his heart?' and they reply in the affirmative. Thereupon He asks, 'What did my slave say?' They say: 'He praised You and said: Inna lillahi wa inna ilaihi raji'un (We belong to Allah and to Him we shall return).' Allah says: 'Build a house for my slave in Jannah and name it Baitul-Hamd (the House of Praise)."'.
Source
Riyad as-Salihin(رياض الصالحين)
The Book of Visiting the Sick
Hadith Number
243