The new rule was introduced on March 3. State media have said, “All people who have lived or traveled in coronavirus-affected countries such as South Korea, Italy, Iran and Japan in the 14 days prior to their arrival in Shanghai must undergo 14-day quarantine at home or in designated places for medical observation, city officials said at a press conference on Wednesday.”
Those countries are emerging as new coronavirus hotspots. From one source we talked to, a couple hours long layover in Japan, just changing flights in the airport, will land you in home quarantine unable to leave your apartment.
The policy is not specific on what factors decide where the quarantine will take place. According to one chef we talked to, returning from Northern Italy, he was originally destined for the hotel but was able to convince the authorities to allow him to do his time at home. From another source, we heard that there are quarantine hotels in both Changning district and Pudong district, and they would require the person staying in them to pay for the price of the accommodation and food.
There are concerns the coronavirus could come back around to China. It's happened already. So, if you're currently overseas, keep a close eye on China news to know whether you'll be eligible for the mandatory quarantine or not.