But if they endeavor to make you associate with Me that of which you have no knowledge, do not obey them but accompany them in [this] world with appropriate kindness and follow the way of those who turn back to Me [in repentance]. Then to Me will be your return, and I will inform you about what you used to do.
Allah tells us how Luqman advised his son. His full name was Luqman bin `Anqa' bin Sadun, and his son's name was Tharan, according to a saying quoted by As-Suhayli. Allah describes him in the best terms, and states that he granted him wisdom. Luqman advised his son, the closest and most beloved of all people to him, who deserved to be given the best of his knowledge. So, Luqman started by advising him to worship Allah Alone, and not to associate anything with Him. Then he warned him:
إِنَّ الشِّرْكَ لَظُلْمٌ عَظِيمٌ
(Verily, joining others in worship with Allah is a great Zulm (wrong) indeed.) meaning, it is the greatest wrong. Al-Bukhari recorded that `Abdullah said: "When the Ayah
صَاحِبْهُمَا فِي الدُّنْيَا مَعْرُوفًا (And be with them, in this world, with due fairness - 15).
It means: 'In the matter of the contravention of your faith and religion, do not obey parents. But, when it comes to worldly matters, such as serving parents physically or financially or in any other way necessary, do not fall short about it. Instead, deal with them in mundane matters according to recognized custom. Show no disrespect to them. Do not respond to what they say in a manner that hurts them unnecessarily. In other words, the pain you cause them by not accepting their insistence on Shirk and Kufr is something you will have to bear by, since you have no choice there. But, let this necessity stay within its functional limits and keep abstaining from causing any pain to them in other matters.'
Special Note
As for the weaning period of two years for a child mentioned in the verse, it is in accordance with customary practice. It carries no clarification concerning the injunction relevant to any additional period of suckling the child. A detailed explanation of this issue will, insha'Allah, appear under the commentary on the verse: وَحَمْلُهُ وَفِصَالُهُ ثَلَاثُونَ شَهْرًا (And his carrying and weaning is (in) thirty months - A1-Ahgaf, 46:15).
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 15–18
After God, a man’s parents have the first claim upon his loyalty. But, if the parents’ desire clashes with God’s will, then preference has to be given to God’s will and the parents’ wishes have to be accorded the second place. However, it is necessary even then to continue to serve the parents as usual. Striking this balance between two different requirements is the highest example of wisdom of Islam, and the secret of all successes is hidden in this wisdom.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.