Mustn’t (Must Not)
In negative sense, when talking about “must – should,” it means there is a prohibition.
You mustn’t smoke here. (It is forbidden to smoke here.)
You mustn’t leave the school if you don’t finish your schoolwork.
A scout mustn’t leave the camp unless he has got permission.
Needn’t / Don’t Have To / Don’t Need To (They have the same meanings)
In the present and future tense, when we don’t have to do something:
I needn’t worry about you. (I don’t need to worry about you.)
We needn’t wear gloves unless it snows.
You needn’t / don’t have to wear a suit tonight.
Didn’t Need To / Didn’t Have To
In the past when we didn’t have to do something:
He didn’t need to wear a suit last night.
She didn’t need to / didn’t have to write a formal letter because they required an informal one.
Mike didn’t need to get a taxi because his brother gave him a lift.
You can use these expressions to convey prohibitions or lack of necessity in different tenses.