Well, we can't know how exactly Sherlock deduced that. He is very smart. Faith's memory was hazy, that's why she asked Sherlock to find out exactly who her father needs to kill.
After sometime she thinks that her father's confession was also followed by one word, that means the person he needs to kill is known on a first-name basis.
Moreover, Sherlock kept hearing the word “anyone” all around him and figures out that the name of the person Smith wanted to kill was anyone, leading him to believe that he was a serial killer.
Specifically, he hears this word from Faith...
FAITH: You’re not what I expected. You’re ...
SHERLOCK: What ... what am I?
SHERLOCK: Than who?
... Mary in her recording...
MARY’s VOICE: Don’t think anyone else is going to save him, because there isn’t anyone.
MOLLY’s VOICE: ... if you were to come round asking after him, that he’d rather have anyone but you.
Perhaps, this helped Sherlock to find out the missing word.
source for transcript.