by getting more chakra and stamina by training then feeling the pain of his best friend dying
that or in the timeskip while do some anbu shit he had to kill a friend
My honest opinion is that he "killed" Obito. He didn't really, but Obito died saving Kakashi. Which kind of makes it his fault. And yeah he said in the Pain arc that he failed to save Rin. Good question. I really don't know.. Unless he killed Rin. O_O