The S&P 500 is back to pushing all-time highs, but some stocks are still down substantially from their record highs.

Home Depot (HD 0.51%) is one of them. The world's largest home improvement retailer is down 21% from its peak, due to a slowdown in the housing market and the company's own expectations this year for a decline in revenue and earnings after a boom during the pandemic.

However, despite the near-term weakness, there are a number of reasons for it to be the leading home improvement stock now.

A Home Depot employee arranging merchandise.

Image source: Home Depot.

1. Home Depot stock is historically cheap

Home Depot has traditionally traded at a premium to the S&P 500, as the company has evident competitive advantages in its industry and is a long-term outperformer on the stock market. Over the last 10 years, the stock is up more than 300%, and over its history, Home Depot has been one of the best-performing stocks in stock market history.

Currently, Home Depot trades at a price-to-earnings (P/E) ratio of 20. That's significantly lower than where it's been for most of the last decade, as you can see from the chart below.

Chart showing Home Depot's price and PE ratio down since 2022.

HD data by YCharts

That P/E ratio is also significantly cheaper than the S&P 500's at 26.4, meaning Home Depot stock is trading at a significant discount to the broad market.

2. Long-term tailwinds favor a recovery

Home Depot's recent results explain why the stock is down from its pandemic-era peak.

Comparable sales fell 4.5% in the first quarter, and overall revenue was down 4.2% to $37.3 billion as the company noted deflating lumber prices and a more challenging macroeconomic environment.

Home Depot also lowered its guidance for the year, calling for sales and comparable sales to decline 2% to 5% and for earnings per share to fall 7% to 13% from 2022.

However, the company looks set to return to growth quickly, likely in 2024 as the long-term factors favor it.

First, home prices are already rebounding, showing that the worst of the housing downturn may be over, though inventory and home sales are still low. Additionally, interest rates seem to be close to their peak after the Federal Reserve raised the Fed funds rate to 5.25% to 5.5%. In fact, the Fed expects interest rates to come back down over the next few years, which should favor the housing market and Home Depot.

Finally, there's a significant housing shortage in the country, with some estimates indicating that the U.S. economy needs to add 4 million new homes in order for the market to reach equilibrium. That should translate into a substantial tailwind for Home Depot, as homebuilder stocks have soared as they try to narrow the gap.

3. Home Depot excels at returning capital to shareholders

Home Depot has long had a restrained growth strategy, choosing instead to optimize profitable growth and return remaining capital to shareholders.

The retailer's return on invested capital is often in the 40% range, and the company has resisted opening new stores, unlike rival Lowe's. This has given it more money to invest in its tech infrastructure and other growth initiatives.

The company currently offers a dividend yield of 2.6%, and it has a strong track record of dividend growth, raising the payout every year for the last decade by 10% or more.

Similarly, it has also been buying back stock, and the sell-off in the stock offers a good chance for the company to take advantage of it by repurchasing the stock. Over the last decade, shares outstanding have fallen by about a third.

Even in a challenging first quarter, Home Depot still posted an operating margin of 15%, showing the business itself remains strong even in a difficult macro environment. 

Once conditions improve, Home Depot looks poised to be a reliable winner on the stock market.