How would I know that the sentence should have "кто-либо" and not "кого-либо" in it?[/quote]
As Zaya said, you need to find the subject.

Who will know?
кто-либо. (nominative)

So, it's the...