Kaido learned about Joy Boy from Rocks. But, Rocks didn't know about Nika, just Joy Boy.
When Kaido saved King, he thought he could be Joy Boy.
IMO, when Kaido found Jack at Fish-Man Island, he also talked to Shyalrly (who, as a 3-year-old was somehow already doing prophecies). This was around the same time Queen joined up.
Whatever Shylarly told Kaido, is what dictated everything he did after that point. I think she more or less told Kaido:
-You aren't Joy Boy. Joy Boy is the man who will defeat you. Your defeat will lead to the Dawn.
-You will die in the land of Wano, to a Samurai
2nd part is ZKK dependent and iffier, but I 100% Shylarly told Kaido to his face he isn't Joy Boy.
Once Kaido couldn't be Joy Boy, he dedicated his life to creating Joy Boy. IMO, Kaido thought it would be Ace, and got really depressed post-Marineford. Luffy becoming Joy Boy IS WHAT KAIDO WANTED, but, obviously, Luffy had to earn that shit.