B.B.
Many times kids will say this if they have witnessed it being said or more likely if it was said to them. I know this was the case for my oldest son when he was 3. It was a very short lived thing for us. I asked him how did it make him feel when so and so said "you're not my friend" and he said sad. So I asked if he thought it would make others happy if he said it to them. He said no and stopped saying it. He never yelled it or anything. After all this my son that had witnessed all of this decided he would try to use it. So I asked him if it would make him happy or sad if his brother said "you're not my friend" and he too asnwered that it would be sad. It took probably a week longer to get it out of his system, but I stayed consistant and had my talks with him on the issue. There was even one time I talked to him and then made him sit in time out to think about how he can be nice rather than use rude words. That pretty much ended it. Good luck!
B. :)