It is in Chapter Fifteen that the alliance between Katniss and Rue is made. Let us remember, though, that it is also based on the fact that Rue has already helped Katniss before by pointing out the tracker jacker nest that Katniss is able to use with such devastating effect against the careers. Katniss clearly feels that she is able to trust Rue, as she says when Rue asks her if she wants her for an ally:
Why not? You saved me with those tracker jackers. You're smart enough to still be alive. And I can't seem to shake you anyway.
Above all, Katniss is drawn to form an alliance with Rue because she is a "survivor" and above all because she reminds Katniss of Prim, her younger sister. Rue by nature is young and also looking for somebody to look after her in this grim and brutal environment, and Katniss serves this purpose for her. The two are drawn together by mutual sympathy and openness.
Rue trusts Katniss after seeing the mockingjay pin. Katniss trusts Rue because she reminds her of Prim. Katniss also thinks that Rue is clever and decides that she wants her as an ally. Hope that helps.