So I came across this sentence その元気な男の子にはたくさんの友達がいます。I was wondering what には was doing in this sentence. Additionally, I was wondering what the different uses and the rules for the uses of には were? So far the most comprehensive list I've found is here https://en.wikipedia.org/wiki/Japanese_particles, and the only rules I've found so far where in the Dictionary of Intermediate Japanese Grammar, defined as verb plain form or suru noun in front of には as being for the purpose of.
には is just the particle に combined with the particle は. The meaning isn't really different, but in most cases, the interpretation of は is the "contrastive" one, so it adds that nuance. In your example, what the sentence is saying is that energetic boys specifically have lots of friends, as compared with other kinds of boys. Hopefully that shows you what exactly the "contrastive" nuance is meant to convey. As for rules for using it, you can follow the same rules as に, but you might make your sentence sound weird if you add it when you don't really need to.