The mantra I always used with my children:
Are you telling me to get [subject of tattle] out of trouble, or into trouble?
Letting me know that someone is doing something they need rescuing from is welcome; letting me know that someone is doing something they need a timeout for, not so much. And telling me about a misbehaviour that has already been dealt with by whoever is there to deal with it, even less. I don't mean the problem has to be huge. "Jimmy has juice on the carpet!" can prevent the trouble that will follow a spill if I can pop over to the carpet and pick up either Jimmy or the juice and get them back somewhere that juice is allowed. Telling me mitigated things. But once it has spilled, or if it spilled this morning and someone else already cleaned it up and dealt with it? You're just flat out tattling.
Now, in a really small child, there's another reason for telling you:
X had a tantrum today. That's not good, is it? How would you react if I had a tantrum? How should I react when a tantrum happens near me? They're scary. But not unbearably awful, right? And you can help me learn to control myself, right? And you'll love me even if I'm bad, right? But I should still try not to be bad, right? Or ok, I'm not being bad, I'm just doing something that isn't the best to do. Or something. But wow, tantrums just seem to start out of nowhere. And then after he had to sit in the naughty chair [or whatever] and I don't want to do that, so I hope I don't have one, but I might, so wow can we talk about this a bit?
But if you're two, about all that manages to come out of your mouth is "X had a tantrum today."
Inappropriate reporting can easily be replied with "let's not talk about that right now [or right here]" and some sort of redirection. Later, perhaps on the way home when the others aren't around, you can prompt "did you want to talk about [whatever X did] now?" If you don't offer to discuss it shortly after the original report, then "not now" means "swallow your feelings and never talk about other people or learn from your observations" which you don't want. But a parent can guide when and where is best for those kinds of talks.
Lets-you-and-him-fight tattling gets the "in or out of trouble" line. The nice thing about this approach is that it also works when your child is 7, and has a friend who is breaking her own house rules, or is 12 and has a friend who is drinking her father's beers, or is 17 and has a friend who is and planning to run away (or worse.) My kids have reported their friends' behaviours to me when it was needed, and I've been able to keep them out of trouble occasionally as a result. They've also reported teachers and other authority figures who were not doing the right thing. I like that about my kids. But I've not needed to deal with that whiny someone-broke-a-rule-while-you-weren't-looking tattling, and that's made me pretty content.