Canada bans most foreigners from buying homes