Complex sentence: The system was in place when the Hong Kong and Macau were under British and Portuguese rule, and was retained after their sovereignty were transferred to the PRC in 1997 and 1999 respectively under the One country, two systems policy.
Split into simpler sentences: The system was put in place when Hong Kong and Macau were under British and Portuguese rule. It was retained after their sovereignty was transferred to the PRC in 1997 and 1999 respectively under the One country, two systems policy.