This question already has an answer here:
I would like to know what the difference is between the two spellings of the long o (ō), in hiragana, namely おう (ou) and おお (oo). Are these pronounced the same?
If so, then why does Japanese have these two different spellings for the same long o vowel?
Also, when transcribing from a textbook that uses romaji to teach Japanese, and entering the characters at the keyboard, is there a set criterion for curbing which combination I should be using (and dots it matter)?