One of the peculiar outcomes of the coronavirus pandemic has been a soaring housing market in the U.S. Folks are spending a lot more time at home, which increases their appetite for buying a home. 

According to the Federal Reserve Bank of St. Louis, in the third quarter, year-over-year home prices increased at the fastest rate in the last 45 years. During an environment of rising house prices, home improvement businesses thrive. Here's why Lowe's (LOW -1.40%) and Home Depot (HD -1.77%) are my top two home improvement stocks to buy in 2022.

Two adults installing a light fixture in a bright room with white brick walls and large windows.

Image source: Getty Images.

Lowe's

Lowe's was experiencing a several-year-long deceleration in revenue growth before the pandemic caused sales to surge by 24% in 2021. Management told investors to expect revenue to decrease slightly in its fiscal year 2022.

Still, management thinks Lowe's operating profit margin will expand by 10 to 30 basis points even though sales could decrease. If it can achieve that feat, it would be four straight years Lowe's has increased operating profit margin: starting in 2019 at 5.6%, to 8.8% in 2020, on pace for 12.4% in 2021, estimated to be higher in 2022. That has flowed to the bottom line where earnings per share has compounded at an annual rate of 18.5% in the last ten years.

Lowe's management mentions that one of the drivers fueling spending at its stores and on its website is rising home values. Lowe's could do even better than management estimates if house prices keep increasing at record rates in 2022. What's more, Lowe's is trading relatively inexpensively, at a price-to-earnings ratio of 22 and a price-to-free cash flow of 26.

Home Depot 

The pandemic has helped sales at Home Depot as well. The same macroeconomic factors driving revenue growth at Lowe's are inevitably boosting sales at Home Depot

Indeed, sales have increased at a compounded annual rate of 6.9% for Home Depot in the last decade. While other brick-and-mortar businesses have suffered competitively against e-commerce retailers, Home Depot has held its ground. Home improvement retailers like Home Depot and Lowe's sell big and bulky items that are difficult to ship. Additionally, they sell products purchasers need very quickly. Those qualities help drive people to their stores.

Like Lowe's, Home Depot is generating healthy operating profitability, only better. In fiscal years 2018, 2019, and 2020, Home Depot earned an operating profit margin of 14.5%, 14.6%, and 14.4%, respectively. Solid operating profits have caused earnings per share to expand at a compounded annual rate of 19.5% in the last decade.

The better performance is already priced into Home Depot's stock. It's trading at a price-to-earnings ratio of 26.7 and a price-to-free-cash flow ratio of 35.2. Admittedly, Home Depot is more expensive than Lowe's. However, Home Depot earns that valuation through better revenue growth and operating profit margins.

Regardless, both Home Depot and Lowe's are excellent businesses riding the tailwind of soaring home values. That's what makes them my top home improvement stocks to buy in 2022.