From your question, I'm assuming you mean these three expressions:
(1) Oh my god!
(2) Oh my goodness! (I think you made a typo "godness" --> sp?)
(3) Oh my gosh!
All of the above expressions mean the same time. They are used when one is surprised, upset, frustrated, happy, shocked, etc. The intonation of these sentences reveals the emotion of the person.
"goodness" and "gosh" are euphemisms for "god". This means that "god" was replaced by "goodness" and "gosh" so that the expression would not be offensive.