Ottawa has announced new rules aimed at limiting foreign money into Canadian real estate and ensuring that borrowers take on mortgages they can afford.

"Overall, I believe the housing market is sound, but as minister of finance, I want to make sure we are proactive in assessing and addressing the factors that could lead to excess risk," Finance Minister Bill Morneau said in making the announcement Monday in Toronto.

They include a move to close a loophole in the tax laws that allows non-residents to buy homes in Canada, and then get a tax exemption to avoid paying capital gains when they sell the home by claiming it as a principal residence.

Morneau takes measures to cool Vancouver and Toronto housing markets 1:04

Starting now, "an individual who was not a resident in Canada in the year the individual acquired a residence will not be able to claim the exemption for that year," Morneau said.

Canadians who were legitimate residents at both the time of purchase and time of sale will still be able to take advantage of the principal residence tax exemption, Ottawa says.

Toronto real estate lawyer Bob Aaron says the move is a reasonable step to prevent tax leakage.

"There's a lot of people who are declaring their homes as principal residences when they're not," he said in an interview. "I think it's more of cracking down on the existing law rather than plugging a loophole."

Today’s <a href="https://twitter.com/hashtag/housing?src=hash">#housing</a> measures bring consistency to mortgage rules, reduce risk for<br>taxpayers and ensure everyone is playing by the rules. —@Bill_Morneau

In addition to cracking down on tax leakage by foreign money, another change is that from now on, all insured mortgages must undergo a "stress test" that ensures a borrower's ability to make their mortgage payments at a higher interest rate.

Effectively, that means borrowers will be tested against their ability to pay their mortgage if actual rates were as high as the big bank's five-year posted mortgage rates, which the Bank of Canada says currently average 4.64 per cent.

That requirement was already in place for many borrowers, including so-called "high-ratio" mortgages for people with small down payments, and borrowers who borrowed money on terms of less than five years.

But from now on, any insured mortgages will be tested against that higher bar. Anyone who already has a mortgage, or who has already applied for mortgage insurance, is exempt from the new rules, which will formally kick in on Oct. 17.

That could have a big impact on buyers.

According to interest rate-comparing website RateHub, a hypothetical borrower with $100,000 in annual income and $40,000 to put down on a house today could qualify for a house worth $665,435 with a mortgage at 2.17 per cent, which three lenders are currently offering, according to the site.

But under the new rules, that same buyer could only qualify to buy a home for $505,762, or 24 per cent less than before the rules kick in. The lender is still willing to offer that lower rate, but the borrower would no longer be allowed to get it under the stricter rules, because his or her finances would be tested as though the mortgage rate is more than twice as high as it is in reality.

That's why BMO economist Sal Guatieri thinks the new stress test is the more significant change of those announced Monday.

"This measure will make it harder for buyers to qualify for a loan, especially in high-priced regions," he said.

"This means that many potential buyers won't qualify for an insured mortgage, which requires the total carrying costs of a home ... to consume no more than 39 per cent of gross family income," Guatieri said.

"The measures announced today should help to reduce the risk of a housing market correction in Vancouver and Toronto and a broader retrenchment in Canadian household spending arising from elevated debts."

The issue of foreign money's impact on Canadian housing has come under intense scrutiny in recent months as housing prices have been increased at double-digit annual paces in the two large markets: Toronto and Vancouver.

This summer, the government of B.C. slapped a 15 per cent surtax on foreign buyers in the Metro Vancouver area in an attempt to cool runaway price inflation.

CIBC said it expects that Toronto will have "no choice" but to do the same at some point.