How to distinguish use cases of these verbs?
Mustn't is a negative form of modal verb. We should use when something prohibited.
You mustn't talk in the library.
Needn't it's regular verb with negative meaning. We should use to express lack of necessity.
You needn't water the garden. Tomorrow will be rain.
Btw am I right that needn't is equal to don't have to?