Kevin O'Leary: Unless you can pass this 2-question test, don't buy a home

While the classic advice from financial experts and possibly your parents is to figure out how to stop renting and buy a home, you won't hear it from Kevin O'Leary.

Instead, the investor on ABC's "Shark Tank" and personal finance author suggests that people in their 20s avoid taking on a mortgage until they've hit other personal milestones. "I think the key to life — particularly when you're young — is to stay out of debt," O'Leary tells CNBC Make It.

Whether to buy or rent is a "crucial decision," says O'Leary, and in order to help you make the right choice, he offers up this two-question test.

"Are you married?" asks O'Leary. "If the answer is no, rent."

"If you're married, do you have children?" he asks. "No? Rent."

RELATED: 10 cities where cost of living will soar in 2018

10 PHOTOS
10 cities where cost of living will soar in 2018
See Gallery
10 cities where cost of living will soar in 2018

10. Miami

Forecast year-over-year change in home value: 1.39%
Forecast year-over-year change in rent: 2.38%
CPI 2016-2017: 3.13%
Average CPI change 2014-2017: 1.76%

Florida ranked as one of the worst states for families to live a richer life in a separate GOBankingRates study. Its median household income is below the national average, and median home list prices are higher than in most states.

Housing costs — including home values and rent — are predicted to continue to rise in Miami. A research study conducted by Zillow reported that Miami residents are paying almost $7,000 more in rent now than they did during the pre-housing boom.

9. Tampa, Fla.

Forecast year-over-year change in home value: 2.92%
Forecast year-over-year change in rent: 2.27%
CPI 2016-2017: 2.84%
Average CPI change 2014-2017: 1.22%

Home values are expected to continue rising at a high rate in Tampa, which is good news for people who already own a home there. In fact, a separate GOBankingRates study found that Tampa is one of the best cities in the country to own an investment property — but that's bad news for people looking to buy a home.

Rent is also expected to increase in Tampa, as is the cost of consumer goods and services. The steadily increasing housing costs earned Tampa the No. 9 spot in GOBankingRates' cost-of-living index by city.

8. Phoenix

Forecast year-over-year change in home value: 3.21%
Forecast year-over-year change in rent: 3.87%
CPI 2016-2017: 2.75%
Average CPI change 2014-2017: 1.34%

The cost of renting vs. owning a home in Arizona is roughly equivalent, a separate study found. Both of those costs are expected to continue to rise in Phoenix next year, which will make both options less affordable.

Currently, the median home price in Phoenix is $242,100, and the median rent is $1,344, according to Zillow. In our comparison of cost of living by city for 2018, Phoenix took the No. 8 spot.

7. Dallas-Fort Worth

Forecast year-over-year change in home value: 5.58%
Forecast year-over-year change in rent: 2.82%
CPI 2016-2017: 2.27%
Average CPI change 2014-2017: 0.87%

Of the major metropolitan areas included in this study, Dallas-Fort Worth had the largest predicted increase in home value. Realtor.com's 2018 National Housing Forecast predicted that Dallas-Fort Worth will become the No. 2 housing market in the country in 2018. The rapidly increasing home prices give Dallas-Fort Worth the No. 7 spot on GOBankingRates' cost-of-living comparison by city for 2018.

6. San Francisco

Forecast year-over-year change in home value: 1.4%
Forecast year-over-year change in rent: 0.92%
CPI 2016-2017: 3.56%
Average CPI change 2014-2017: 2.95%

San Francisco had the largest increase in the cost of consumer products and services over the last three years compared to all the other major cities included in this study. While housing and rent prices are not predicted to increase dramatically in the coming year, they are already very high.

A previous study found that San Francisco tops the list of most expensive cities in the U.S. to live comfortably in thanks to its high housing costs. Of the five most expensive cities to live in the U.S., it's the one where cost of living is expected to rise the most next year.

5. San Diego

Forecast year-over-year change in home value: 2.86%
Forecast year-over-year change in rent: 3.91%
CPI 2016-2017: 3.28%
Average CPI change 2014-2017: 2.01%

California has the fourth-highest cost of living of all the states, so it's not surprising a few of its cities have made this list.

San Diego currently has the fourth-highest median home list price and median rent of all of the major metro areas in the U.S., according to Zillow. And, prices are expected to continue to rise next year.

4. Atlanta

Forecast year-over-year change in home value: 3.34%
Forecast year-over-year change in rent: 5.08%
CPI 2016-2017: 3.15%
Average CPI change 2014-2017: 1.51%

Atlanta ranked as the No. 2 city with skyrocketing home prices between 2016 and 2017, according to an earlier GOBankingRates study. And home prices are expected to continue rising in 2018. Rent is also expected to increase at a high rate, making housing more difficult to afford overall.

3. Denver

Forecast year-over-year change in home value: 3.52%
Forecast year-over-year change in rent: 4.37%
CPI 2016-2017: 3.09%
Average CPI change 2014-2017: 2.36%

In Denver, a high demand for homes and a low supply of available housing will continue to drive up home prices in the city in 2018, according to the Denver Metro Association of Realtors' Market Trends Committee. Rent is also expected to increase, as is the overall cost of consumer goods and services in the city. Of the metro areas included in this study, Denver saw the third-highest average CPI change from 2014 to 2017.

2. Seattle

Forecast year-over-year change in home value: 4.86%
Forecast year-over-year change in rent: 5.73%
CPI 2016-2017: 2.98%
Average CPI change 2014-2017: 2.07%

In another study, Seattle ranked as the No. 2 city where cost of living was rising the fastest in 2017. And costs are predicted to continue to rise in this Pacific Northwest city in 2018.

Of the metro areas included in this study, Seattle is expected to see the second-highest increase in home value and the largest increase in rent. The city has grown rapidly in recent years thanks to Amazon and the tech boom, causing the cost of living to rise rapidly.

1. Portland, Ore.

Forecast year-over-year change in home value: 2.81%
Forecast year-over-year change in rent: 5.34%
CPI 2016-2017: 4.42%
Average CPI change 2014-2017: 2.49%

Portland is expected to experience the largest cost of living increase in 2018 compared to the other metro areas included in this study. And it's also predicted to experience the second-highest increase in rent.

Between 2016 and 2017, this popular city saw the largest increase in cost of consumer products and services. A separate GOBankingRates study found that the average income in Portland is not enough to keep up with the rising costs of living there.

HIDE CAPTION
SHOW CAPTION
of
SEE ALL
BACK TO SLIDE

MORE FROM CNBC: Barbara Corcoran: If your kids have this trait, they'll be successful

Many financial experts argue home ownership is a way to build wealth, because it gives you equity in an appreciating asset. But O'Leary cautions that homes may not always gain as much value as you expect — at least not anymore and at least not quickly.

"A lot of people say to me, 'If I'm only renting, I'm not building any equity in my home,'" O'Leary says. But, since buying a home usually means taking on debt, it is important to consider changing trends in the interest rates for mortgages, which can be thought of as the price you pay to borrow money.

For the last 35 years, the trend line for the U.S. 10-year Treasury yield, a benchmark for mortgage rates, has been more or less straight down, bottoming out at below 1.5 percent from a 1981 high of around 15 percent.

"Any asset that involves taking debt to own it, like a mortgage, like a house, appreciated in value while interest rates were going down," O'Leary explains. "Well guess what? Interest rates aren't going down any more. Asset classes like real estate stop going up in value when it costs more to borrow the money to buy them."

MORE FROM CNBC: You may be paying off your credit card debt wrong—here’s the best way

Currently, mortgage rates are rising — as of Feb. 1, the average 30-year fixed mortgage rate was 4.22 percent, according to Freddie Mac, the highest it's been in months.

RELATED: Top 10 cities with the highest quality of living

11 PHOTOS
Top 10 cities with the highest quality of living
See Gallery
Top 10 cities with the highest quality of living

1. Vienna, Austria

Original caption: The Wiener Riesenrad, or Riesenrad, is a 64.75-metre (212 ft) tall Ferris wheel at the entrance of the Prater amusement park in Leopoldstadt, the 2nd district of Austria's capital Vienna. It is one of Vienna's most popular tourist attractions, and symbolises the district as well as the city for many people. Constructed in 1897, it was the world's tallest extant Ferris wheel from 1920 until 1985.

2. Zurich, Switzerland

3. Auckland, New Zealand

Original caption: Auckland Skyline Twilight - Auckland, New Zealand's largest city, under a dramatic twilight sky.

4. Munich, Germany

Original caption: Marienplatz (en: Mary's Square, i.e. St. Mary, Our Lady's Square) is a central square in the city centre of Munich, Germany. It has been the city's main square since 1158.

5. Vancouver, Canada

Original caption: Vancouver with False Creek in foreground and Grouse Mountain and the North Shore Mountains in background.

6. Dusseldorf, Germany

Original caption: View of the Skyline of Dusseldorf and the Rhine River

7. Frankfurt, Germany

8. Geneva, Switzerland

Original caption: Beautiful view of the water jet fountain with rainbow in the lake of Geneva and the cityscape of Geneva at sunset, Switzerland

9. Copenhagen, Denmark

Tie-10. Basel, Switzerland

Original caption: Mittlere Bridge in its current form was built in 1905, but its predecessor was one of the most important crossings of the Rhine. The first bridge was build in 1226 and the city was extended on the other side of the river just for securing the bridge. On the left of the image the St-Martin Church (14th century parish church) overlooks the beautiful waterfront houses. HDR image taken early in the morning with clouds clearing out after a stormy night.

Tie-10. Sydney, Australia

Original caption: Sydney, Australia - September 5, 2013: Beautiful Opera house view at twilight time with vivid sky and illumination on the bridge.

HIDE CAPTION
SHOW CAPTION
of
SEE ALL
BACK TO SLIDE

That means a home won't continue to be as safe an investment, or at least not as safe in the short term, he says, so it will be harder to buy and assume you can flip it for a profit.

"Let's say you buy a house for $200,000 and you think 'Oh, gee next year it is going to be worth $250,000!' That might have been true 10 years ago, but I don't think it is going to be true next year, or the year after that, because when rates start going up, and money costs more, and mortgage rates are higher every month, the value of real estate goes flat. Or, often goes down," he says.

Other experts add that the typical return on an investment in residential housing isn't as good a bet as the stock market usually is. So there may be better ways to put your money to work.

MORE FROM CNBC: How to lower your housing costs, whether you rent or own

That's why O'Leary says the time to take on mortgage debt is when you're settled in your career and family life.

"When you form a family and you're thinking of having let's say two kids, that's the time to start thinking about a home, because you know for about five to seven years you're going to be raising your children and you need a safe place for them," he explains.

But even then, make sure you can afford it.

While 85 percent of millennials expect to buy a home, a 2017 survey by GOBankingRates found that many young people don't have the necessary savings. According to the survey, 46 percent of young millennials (defined as those aged 18-24) had no money in a savings account. For older millennials (ages 25-34), 41 percent had zero put away.

"You've got to make sure the mortgage payment is only one third of your after-tax income," O'Leary says. "If you're paying more than one third of your after-tax income, you bought a house that was too big and you can't afford it, because there are a lot of other costs in life: education, clothing for your kids, food, maybe you're leasing a car."

The consequences of doing otherwise can be dire: "Don't let it get more than that," he warns, "or you'll find yourself in financial stress, and the first place that plays itself out: divorce."

Don't miss: 'Shark Tank' investor Kevin O'Leary: Here's how to get rich

Like this story? Like CNBC Make It on Facebook!

Read Full Story