Foreign residents barred from buying existing homes for two years