Praise be to Allah.
There is nothing wrong with calling your son after your husband’s father. This is a sign of the son’s respect and love for his father, especially when his name includes the names of two Prophets.
The fact that the child is called after a Prophet or a Sahaabi – let alone after your father-in-law! – does not mean that he cannot be scolded or rebuked. You have the right to call him as any mother calls her child, without having to use titles of respect.
The fact that a child is called by a name that is beloved to Allaah or by the name of one of the Prophets does not mean that he cannot be punished or rebuked when he does something wrong. The Prophet (peace and blessings of Allaah be upon him) commanded parents and guardians to teach their children to pray when they are seven years old and to smack them if they do not pray when they are ten years old. The Prophet (peace and blessings of Allaah be upon him) did not make an exception for anyone whose name is Muhammad or any other name with regard to this ruling.
It is proven in many cases that the Sahaabah and Taabi’een rebuked, scolded and smacked their children, and many of them were called Muhammad, ‘Abd-Allaah and ‘Abd al-Rahmaan.
It is known that the name usually has an effect on the person who carries it. Hence the Prophet (peace and blessings of Allaah be upon him) changed bad names to good names.
Ibn al-Qayyim said:
Because names have meanings, these meanings will inevitably have an effect on the person who carries the name. Names have an effect on the things that are named, and the things that are named have an effect on their names, whether they are beautiful or ugly, light or heavy, subtle or crude.
Zaad al-Ma’aad, 2/336
Shaykh ‘Abd al-‘Azeez ibn Baaz was asked about the soundness of the hadeeth, “Whoever is called Muhammad should not be beaten or insulted.”
He said: This hadeeth is fabricated and falsely attributed to the Messenger of Allaah (peace and blessings of Allaah be upon him), and it has no basis in the pure Sunnah. The same applies to the saying, “Whoever is called Muhammad under the protection of Muhammad and his name will bring him close to Paradise.” The same applies to those who say, “Whoever is called Muhammad his household will have such and such…” All of these reports have no sound basis. What matters is following Muhammad (peace and blessings of Allaah be upon him), not being called by his name. How many of those who are called Muhammad are evil, because they do not follow Muhammad or implement his sharee’ah. Names do not purify people; what purifies them is their righteous deeds and their fear of Allaah. So whoever is called Ahmad or Muhammad or Abu’l-Qaasim and is a kaafir or an evildoer will not benefit from his name. Rather what each person must do is fear Allaah and strive to obey Allaah and adhere to the sharee’ah of Allaah with which He sent His Prophet Muhammad. This is what will benefit him, and this is the way to salvation. As for names without acting in accordance with sharee’ah, they have nothing to do with salvation or punishment.
Majmoo’ Fataawa al-Shaykh Ibn Baaz, 6/370
And Allaah knows best.