No rule for this one
No ending or word group predicts the article of Stock. Learn it as a pair and say it out loud: der Stock.
der Stock
It's der Stock. Stock is masculine, plural die Stock.
Die Wohnung ist im dritten Stock.
The apartment is on the third floor.
No ending or word group predicts the article of Stock. Learn it as a pair and say it out loud: der Stock.