Unfortunately, there are no hard-and-fast rules for the pronunciation of “oo”, so you will just have to remember the correct variants, but there are a few patterns that may help you memorize them.
The short pronunciation
(好木脚,在/k/前发短/u/),good, wood, foot, book, cook…)
The letter group ook is mostly pronounced as [ʊk], with a short “u” as in “put” (the only exceptions are “spook” and “snooker”, which are pronounced with a long “oo”):
brook /brʊk/
cook /kʊk/
crook /krʊk/
hook /hʊk/
look /lʊk/
rook /rʊk/
rookie /ˈrʊki/
shook /ʃʊk/
took /tʊk/
hood /hʊd/ and -hood words, e.g.:
childhood /ˈtʃaɪldhʊd/
motherhood /ˈmʌðə(r)hʊd/
neighbourhood, neighborhood /ˈneɪbə(r)hʊd/
stood /stʊd/
understood /ʌndə(r)ˈstʊd/
wood /wʊd/
The other words pronounced with a short [ʊ] are:
moor /mʊə/ UK, /mʊr/ US or /mɔː/ UK, /mɔːr/ US
poor /pʊə/ UK, /pʊr/ US or /pɔː/ UK, /pɔːr/ US
soot /sʊt/
wool /wʊl/
Finally, words derived from the words above, such as footing from foot, looked from look, etc., are also pronounced with a short [ʊ].
The long pronunciation
The vast majority of English words containing “oo” that we didn’t mention above are pronounced with a long [uː]. Here they are (exceptions to the rules mentioned above are marked with “(!)”):
boost /buːst/
boot /buːt/
brood /bruːd/ (!)
choose /tʃuːz/
cool /kuːl/
coot /kuːt/
crooner /ˈkruːnə(r)/
doom /duːm/
drool /druːl/
droop /druːp/
food /fuːd/ (!)
fool /fuːl/
hoop /huːp/
hoot /huːt/
loop /luːp/
loose /luːs/
loot /luːt/
mood /muːd/ (!)
moon /muːn/
moose /muːs/
moot /muːt/
noon /nuːn/
pool /puːl/
proof /pruːf/
root /ruːt/
school /skuːl/
schooner /ˈskuːnə(r)/
scoop /skuːp/
shoot /ʃuːt/
soon /suːn/
spook /spuːk/ (!)
spool /spuːl/
snooker /ˈsnuːkə(r)/ (!)
snooze /snuːz/
stool /stuːl/
stoop /stuːp/
tool /tuːl/
toot /tuːt/
tooth /tuːθ/
troop /truːp/
zoom /zuːm/
Furthermore, all words ending with “oo” are pronounced with a long [uː], for example,
cuckoo /ˈkʊkuː/
igloo /ˈɪɡluː/
kangaroo /ˌkæŋɡəˈruː/
loo /luː/
shampoo /ʃæmˈpuː/
taboo /təˈbuː/
tattoo /təˈtuː/
too /tuː/
voodoo /ˈvuːduː/