By definition God is greater than which none can be conceived.
God can be conceived of as just an idea, or as really existing.
It is greater to exist than not to exist.
Therefore, God must exist.
Over time various philosphers have exposed the flaws in this argument.
Initially Anselm's contemporary, the monk Gaunilo, objected that logically one could prove anything exists by this argument. St Anselm's response was that this argument could only be applied to God, because only He could be perfect and unique.
But it was not until Emmanual Kant in the late 18th Century that the Ontological argument appears to be have been conclusively rebutted. Kant showed that the argument wrongly assumes that existence is a property. According to St Anselm the concept "God" contains contains the idea of existence. So the statement "God does not exist is a contradiction in terms. Therefore he must exist. But Kant claimed that existence does not add anything to, or define, a concept. To say something exists merely means that some object corresponds to the concept. Existence is not the same as a concept. Therefore it is not true that "God exists" must be true.
However, this argument is still used today in various forms, and with further justifications and explanations.
In future posts I'll summarize further arguments. Next will be the "Cosmological Argument"