'The Goat' - Season 3, Episode 17
After Barney sleeps with Robin he gets help to find a loop hole in "The Bro Code" to let him off the hook.
Air Date: April 28th 2008.
Marshall: We can't keep a goat.
Lily: But she's so cute and fuzzy and soft.
Marshall: Yeah, and it also sheds, eats garbage, and can't control its bowel movements. Why don't we just call Duluth Mental Hospital and say my Uncle Linus can live with us?
Barney: Are you saying you don't want to be bros anymore?
Ted: I'm saying I don't want to be friends anymore.
Ted: Hey, Barney, I'm getting rid of some of my old stuff. Do you want my Xbox?
Barney: (Thinking that Ted is referring to Robin) Shame on you! She has a name! What kind of man do you think I am?
Ted: Uh, someone who likes video games?
Barney: So ... I just slept with my best friend's ex-girlfriend.
Robin: And I just slept with my ex-boyfriend's really good friend.
Barney: (Correcting her) Best friend.
Barney: I'm horrified that this happened.
Ted: How did it happen? Ahh? Barney? I want to know. Tell me exactly how it happened.
Barney: You mean, what position?
Barney: You can't tell anyone. Attorney-client privilege.
Marshall: Why are you doing this to me?
Barney: Because I need you, Marshall, as my lawyer to prove I didn't do anything wrong.
Marshall: How can I help you as your lawyer? You didn't break any laws, did you? Robin knows that you slept with her, doesn't she?
Barney: I didn't break any state or federal laws. But I think I broke a much, much higher law. The Bro Code.
Barney: I can't keep buying things! I have six self-cleaning litter boxes and I don't even HAVE a kid.