Is the same to say Menschen and Leute? When are they exchangeable? I've heard that if you know the people you use one of this words, but I don't know which. (And I don't know if what I've heard is true either.)
The way I always explain it is that Menschen is shifted toward human while Leute is shifted toward a colloquial use of people... maybe a bit like folk(s). Consequently, Leute is also fine if you're going down the derogatory route but it is not part of the word per se.
Let's look at some examples now. If you talk about your last night out and you describe the bar you'd use Leute.
Da waren viele merkwürdige Leute.
Menschen would sound weird because it has this emphasis on human, which is totally superfluous. On the other hand, if you talk about people suffering from a disease it makes sense to bring the human side in there. Leute would sound too casual.
Menschen, die an dieser Krankheit leiden...
Also here, Leute would be wrong
Irgendwann leben Menschen auf dem Mars.
The point is that humans live there... not just some random dudes. There is an overlap in the middle where either version is fine. A politician could use either one in a speech.
Die Menschen/Leute wollen wissen, wie es weiter geht.
One big grammatical difference is that Menschen has a singular whereas Leute hasn't. And lastly, it has been pointed out in comments that there is a fair number of idioms using Leute.
So... use Menschen if the human aspect bears relevance. Use Leute if you are talking casually and you just mean folks, guys, people, etc.
IMO Leute is usually in the context of local neighborhood where you can define that local on your own. That's why it sounds a bit more intimate and hence also used to emphasize sympathy or familiarness when speaking about those persons, even when you don't know them personally.
Menschen is the more general meaning, just like the individuals or human beings.
There is a wide overlapping set where you can say Leute and Menschen. But if you need to be informal, only use Menschen, like in
Der erste Mensch im All. If you're in a local situation, rather use Leute, like in
Alle kleinen und großen Leute bitte mal hier rüber kommen! or
Was sollen denn die Leute von dir denken?!.