"Должен" (one must, one has to) is the stongest one, then comes "следует" (strongly recommended) and then "нужно" and "надо". "Нужно" and "надо" (it is necessary) are synonyms, but I would say that "нужно" is slightly more formal and more used in the written speech.
As for the grammar, "должен" is used with the Nominative case:
But "следует", "нужно" and "надо" are used with the Dative case.
- Тебе следует купить лопату.
- Тебе надо купить лопату.
- Тебе нужно
купить лопату.
All of them can be used both with the perfective and the imperfective infinitive depending on the situation.
- Ты должен купить фрукты в этом супермаркете. You have to buy fruit in this supermarket now.
- Ты должен покупать фрукты в этом супермаркете. You always have t buy fruit in this supermarket.
I would also add "обязан" to this list. It is used with the Nominative case and means "it is obligatory, compulsory). It is even stonger than "должен".