marHaban actually means "welcome", rather than hello
In Saudi dialect it was usually for welcome. Ahlan or Hala was for Hello. It's actually uncommon for people to use Hello, it's more common to say Assalam Alaikum or Salam
I don't agree in many dialects they use it for Hi.. But it pronounces as MarHaBa without the N
This is a course to study Standard Arabic, not dialects. Also, the etymology of the root رحب means to welcome, receive.
Is there any way to predict whether Duo wants you to say "مَرْحَباً" or "أهلاً" for hello?
No. But you can tap on the hints
The hint gives both مرهباً and اهلاً in this case!