BY REY MASHAYEKHI

July 17, 2020 6:00 AM EDT

This article is part of Fortune‘s quarterly investment guide for Q3 2020.

It’s part of the bedrock of the American Dream: owning your own home. Not only is a home the biggest purchase most Americans will ever make, but it’s also likely to be their main investment and best chance to create long-term, sustainable wealth.

While U.S. home prices continued to climb this spring—rising 4.3% year on year in May—there are indications that the pace of that growth is beginning to stall. Zillow is forecasting that housing prices nationwide could fall nearly 2% by October, with prices gradually rebounding to stay flat over the next 12 months.

Still, the U.S. housing market has shown surprising resilience during a pandemic that has devastated the American economy at large. While the number of homes sold has slipped precipitously over the course of the pandemic, prices have proved relatively stable. That’s likely owing to a sharp decrease in overall inventory, as the economic lockdown has led to fewer homes being put on the market for sale.

George Ratiu, senior economist at Realtor.com, notes that the inventory of homes for sale in the U.S. declined 27%, 29%, and 30%, year on year, over each of the last three weeks of June. In that final week, that 30% decline was met with a corresponding 6% jump in median listing prices.

“Sellers are worried about pricing, and the inventory for their next home,” he says. “If they’re going to put their home on the market and sell it, what are they going to buy in return?”

But for would-be first-time homebuyers—those younger, mostly millennial Americans who’ve found themselves renting a home for most, if not all, of their lives—the current situation could present an interesting opportunity. There’s evidence that COVID-19 is prompting demographic changes that could make both buying and renting—especially in more expensive urban areas—a cheaper proposition.

Whether it’s rising unemployment that’s made it harder for many to pay rent, an aversion to living in crowded cities during a pandemic, or the fact that our new work-from-home culture means young professionals no longer have to live so close to where they work, COVID-19 seems to be taking a toll on residential real estate prices in major cities. In über-expensive markets like San Francisco, vacancies are up and rents are down—a phenomenon real estate agents are calling “pandemic pricing.” 

John Fagan, CEO of New York–based digital rental startup Doorkee, says his company has seen renters “shifting away from heavily populated areas.” One moving company that partners with Doorkee has seen “a huge uptick in [clients] moving outside of New York City,” according to Fagan. “I don’t think people will want to buy an expensive condo in a neighborhood where the value proposition is location,” he adds.

Meanwhile, a millennial population that was already trending toward a cheaper, more suburban lifestyle as it grows older and starts to raise families appears to be moving even more quickly in that direction. 

“We were already starting to see a migration away from urban cores for younger buyers in the last two years, and I think the pandemic is pushing that [further],” Ratiu says. “Many of these younger buyers built their careers in the city. When the kids come, that one-bedroom isn’t going to work as well, and schools become a bigger component of a family’s life.”

That means more interest in the suburbs surrounding major cities, such as areas of upstate New York and New Jersey near New York City and, on the West Coast, cheaper and more spacious alternatives to San Francisco like Sacramento, Modesto, and Fresno.

“I’m in New Jersey, and everyone from New York is coming here, because it’s a cheaper price point,” according to Ralph DiBugnara, senior vice president at mortgage lender Cardinal Financial and president of homebuying website Home Qualified. “In the last few years, everyone was moving to cities and wanted that lifestyle, but that has changed. People are thinking that they can work from anywhere, so why pay these high rents?”

Here are the three primary factors experts say to consider in the buy vs. rent debate:

Interest rates

It is, quite simply, what DiBugnara describes as “the lowest interest-rate environment I’ve ever seen.” He notes that “money is so cheap that it’s hard not to think about buying right now.”

The interest rate on a 30-year mortgage is now at all-time low of around 3%—down from over 4.5% a decade ago. That means that a 30-year mortgage on a $500,000 home, for which the borrower paid a 20% down payment, is around $350 per month cheaper than it would have been 10 years ago, according to Bankrate’s online mortgage calculator.

Historically low interest rates are also a boon for those seeking to pay less than the customary 20% down payment on a home, since the monthly payment on a larger outstanding principal would be lower than usual.

DiBugnara says he’s noticed a trend of prospective buyers having taken time during the coronavirus lockdown to evaluate the economics of a potential home purchase, given the low-interest-rate environment.

“Because they had time, a lot more people started to look into it, and some got themselves preapproved [for a mortgage],” he says. “This isn’t a real estate crisis. Lending guidelines haven’t changed; interest rates are low; and it’s easier to get qualified [for a home loan] than it was five or 10 years ago.”

Macroeconomic conditions aside, the decision over whether to buy or rent is, as always, a calculus unique to the persons in question—and the variables around their decision. 

Location and time frame

“Whenever anyone asks me if now is a good time to buy, I ask, ‘How long are you going to stay?’” says Skylar Olsen, Zillow’s senior principal economist. “When is the point in time where the equity buildup [in the value of the home] overcomes the upfront costs?”

Indeed, the variable costs associated with buying a home can add up to be much more than some buyers may expect. In addition to the price of the home and the amount of the down payment, they can include closing costs like mortgage fees and commissions, which can be up to 5% of the home sale price; property taxes, which depend on the location of the home; and future maintenance costs, which vary depending on the age and condition of the property.

Additionally, provisions in the 2017 Tax Cut and Jobs Act have limited some of the tax benefits of owning a home, particularly for buyers in more expensive markets. The bill reduced the home mortgage interest deduction that homeowners could claim on their income taxes—limiting the deduction to a principal of $750,000, compared to $1 million previously—and imposed a $10,000 cap on the amount of state and local taxes, including property taxes, that one can deduct from their federal income taxes.

Zillow’s “Rent vs. Buy” Calculator depicts how such costs factor into the economics of buying a home—depending on where one is looking to live, the value of the property, and other financial considerations. Factoring those variables, the calculator determines what Olsen calls the “break-even horizon”—the point in time in the future when the cost of buying a home becomes less expensive than renting one for that duration.

As is often the case in real estate, the biggest variable is location. While home prices and rents do correlate, the fact is that in more expensive metropolitan areas, what Olsen calls the “price-to-rent ratio” often skews dramatically higher.

“There’s a higher variance, across the U.S., in home prices than there is in rents, in a really big way,” she says. That means that in more expensive markets, one’s “break-even horizon” is often further off in the future than it would be in cheaper locales. In that case, it could make sense to take advantage of the presumably lower rents on offer in the time of COVID-19, while saving up for a bigger down payment. 

But the operative term, of course, is “for now.” Because, as Realtor.com’s Ratiu notes, owning a home still holds a special place in America’s collective imagination.

“In most surveys of consumers where we ask them whether their feeling toward buying a home has changed, the answer overwhelmingly still favors homeownership,” he says. “There’s still a cultural component where people favor it.”

More from Fortune’s Q3 investment guide: