When you wake up and greet your family
When you greet someone in the morning, you say:
Ohayō
Listen carefully, because when you read it, you might try to pronounce each character:
O HA YO U
but instead of pronouncing U at the end, you stretch the sound Yo so it is pronounced like:
O HA YŌ
We use Ā Ī Ū Ē Ō to indicate the lengthened vowel.
Ohayō is an informal way of saying “good morning” so if you greet someone older than you or someone you are not really close to like your teachers, your superiors at work, or neighbors in the morning, you say:
OhayōGozaimasu
Gozaimasu can be added to certain phrases to make them sound polite, but there are no specific rules as to which words it can be added to.
So just remember that the polite version of Ohayō is:
OhayōGozaimasu .
When you see your neighbor in the morning
When you see your friend in the morning
When you greet your teacher in the morning
Greetings between senpai and kōhai in the morning
When you arrive at office and greet your coworkers
When you greet your boss
As you just saw, we use Ohayō or OhayōGozaimasu depending on who we greet.
The rule of thumb is to say Ohayō to someone who you use Tameguchi with, and OhayōGozaimasu to someone who you use Keigo with.
We say OhayōGozaimasu at work even in the afternoon or at night. This is because Ohayō is seen as the first greeting of the day, no matter the actual time.
So, even if you're starting a night shift and it's the first time you're seeing your coworkers that day, we still say OhayōGozaimasu.
It might seem a bit weird, but it's quite common. I remember when I worked at a restaurant and started my shift at 5 pm, we'd all still greet each other with OhayōGozaimasu.
Just so you know this isn't the case everywhere, but you'll find it in many workplaces across Japan.
If you're not in Japan, it's unlikely anyone will greet you with OhayōGozaimasu in the afternoon or night, but it's a good bit of cultural knowledge to have, especially if you're planning to work in Japan.