This means something happened right after another thing. It often shows surprise. Think of it like 'as soon as' or 'the moment that'.
、。
The moment I left the house, it started pouring rain.
、に、。
I was so tired that the moment I got into bed, I fell asleep.
、。
The moment I flipped the switch, the lights in the room didn't turn on.
、。
The moment the criminal saw the police officer, he panicked and fled.
、に。
As soon as my husband got home, he threw down his bag and collapsed onto the sofa.