The Shulchan Aruch · Orach Chayim
אורח חיים רכ״גOrach Chayim 223
Siman 223 of 697 in Orach Chayim — 6 se'ifim
הלכות שאר ברכותLaws of Other Blessings· siman 223
Se’if 1א׳
יָלְדָה אִשְׁתּוֹ זָכָר, מְבָרֵךְ: הַטּוֹב וְהַמֵּטִיב, וְגַם הִיא צְרִיכָה לְבָרֵךְ כֵּן. הַגָּה: וְאִם מֵתָה אִשְׁתּוֹ בְּלֵידָתָהּ, מְבָרֵךְ: שֶׁהֶחֱיָנוּ, דְּהָא לֵיכָּא הֲטָבָה לְאַחֲרִינֵי; וְכֵן אִם מֵת הָאָב קֹדֶם שֶׁיְּלָדַתּוּ, הִיא מְבָרֶכֶת שֶׁהֶחֱיָנוּ כֵּן נִרְאֶה לִי (לְיַשֵּׁב הָרַשְׁבָּ"א סִימָן רמ"ה); וְיֵשׁ שֶׁכָּתְבוּ שֶׁנָּהֲגוּ לְהָקֵל בִּבְרָכָה זוֹ, שֶׁאֵינָהּ חוֹבָה אֶלָּא רְשׁוּת, וּמִזֶּה נִתְפַּשֵּׁט שֶׁרַבִּים מְקִלִּים בְּאֵלּוּ הַבְּרָכוֹת.
One whose wife gave birth, whose benefactor died, who built a new house, and who acquired new vessels — and what blessing he recites. 6 sections: If one's wife gave birth to a male, he recites HaTov veHaMeitiv, and she too must recite it. Rema: If his wife died in childbirth he recites Shehecheyanu, since there is no benefit to others. Similarly if the father died before she gave birth, she recites Shehecheyanu. (This also seems to me to reconcile the Rashba §245.) Some have written that the custom is to be lenient with this blessing since it is optional rather than obligatory, and from this it has spread that many are lenient with these blessings.
Se’if 2ב׳
מֵת אָבִיו, מְבָרֵךְ: דַּיַּן הָאֱמֶת; הָיָה לוֹ מָמוֹן שֶׁיְּרָשׁוֹ, אִם אֵין לוֹ אַחִים מְבָרֵךְ גַּם כֵּן: שֶׁהֶחֱיָנוּ; וְאִם יֵשׁ לוֹ אַחִים, בִּמְקוֹם שֶׁהֶחֱיָנוּ מְבָרֵךְ: הַטּוֹב וְהַמֵּטִיב. הַגָּה: שֶׁאֵין מְבָרְכִין הַטּוֹב וְהַמֵּטִיב אֶלָּא אִם כֵּן יֵשׁ לוֹ שֻׁתָּפוּת בְּאוֹתָהּ טוֹבָה (טוּר).
If one's father died, he recites Dayan HaEmet. If the father left money that he inherits and he has no brothers, he also recites Shehecheyanu. If he has brothers, in place of Shehecheyanu he recites HaTov veHaMeitiv. Rema: One only recites HaTov veHaMeitiv when others share in the benefit. (Tur)
Se’if 3ג׳
בָּנָה בֵּית חָדָשׁ, אוֹ קָנָה כֵּלִים חֲדָשִׁים, אֲפִלּוּ הָיָה לוֹ כַּיּוֹצֵא בְּאֵלּוּ תְּחִלָּה, אוֹ קָנָה וְחָזַר וְקָנָה, מְבָרֵךְ עַל כָּל פַּעַם, שֶׁהֶחֱיָנוּ, וְלָאו דַּוְקָא חֲדָשִׁים דְּהוּא הַדִּין לִישָׁנִים, אִם הֵם חֲדָשִׁים לוֹ, שֶׁלֹּא הָיוּ אֵלּוּ שֶׁלּוֹ מֵעוֹלָם, וְלֹא אָמְרוּ חֲדָשִׁים אֶלָּא לַאֲפוּקֵי אִם מְכָרָן וְחָזַר וּקְנָאָן.
If one built a new house or acquired new vessels — even if he had similar ones before, or if he bought, sold, and bought again — he recites Shehecheyanu each time. "New" is not specifically new — the same applies to used items that are new to him, meaning he never owned these particular ones before. "New" was only said to exclude cases where he sold them and bought them back.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0