Native French speaker here. I can understand why you're confused: when I learned English, I was surprised at how clear the distinctions were... and still they were hard for me to remember.
"Il ne faut pas partir" means that you MUST NOT leave, as in you have to stay where you are, by default. In specific contexts, it could mean that you DON'T HAVE TO leave, but in this case, emphasis will be put on "faut", as in, "it's not that we HAVE TO leave... [but I think we should get going anyway]"
"On ne doit pas partir" is similar, but maybe slightly more ambiguous. Out of context, it means that you MUST NOT leave, by default, and then in specific contexts and/or if you put the emphasis on "doit", it can mean that you DON'T HAVE TO leave.
"Il faut ne pas partir" and "On doit ne pas partir" sound very unnatural to me. The syntax does exist, but it's very rarely used, so rarely in fact that I can't think of a proper example. In both cases, it would mean "we must [not leave]" so "we must stay".
To express the idea that you DON'T HAVE TO leave, without ambiguity, I would recommend the following : "On n'est pas obligé(s) de partir." (without the S for impersonal "on", with it if it really means "we", and if it means "we" and refers to an all-female group, the ending is "ées"). In everyday conversation, you might also come across "On n'a pas besoin de partir", or "I don't need to leave": normally it refers to literal needs, but it is sometimes used in spoken language to mean the absence of obligation just like "don't need to" can mean "don't have to" in English.