Complex sentence: Sambhaji's wife and son, Shahu, who was 7 years of age, remained prisoners of the Mughals for 18 years from February 1689 until Mughal Emperor Aurangzeb died in 1707 when the son Shahu was set free by Emperor Muhammad Azam Shah son of Aurangzeb.
Split into simpler sentences: Sambhaji's wife and son, Shahu, who was 7 years of age, remained prisoners of the Mughals for 18 years from February 1689 until Mughal Emperor Aurangzeb died in 1707. The son, Shahu, was set free by Emperor Muhammad Azam Shah, son of Aurangzeb.