There’s no reliable rule. The letter O often sounds like the core UH sound [ʌ]. You just have to learn the words and train your ear to hear the real sound.
English kept older spellings. Scribes used o in place of u before letters like m, n, v, th to keep handwriting legible — the “scribal o”. Pronunciation shifted, spelling didn’t. That’s why we get love, some, son, mother with the UH sound [ʌ].
Why English spelling is so inconsistent →
The history of the scribal o →
Click ▶ to hear real American pronunciation (YouGlish — US accent)