This argument is based around the definition of God.
Anselm had previously concluded, in his book Monologian, that God was "that than which nothing greater can be conceived". His argument relies upon this assumption.
He said that an atheist understands this concept, even if he does not believe in God
He then argued that it must be greater to exist in reality than to exist in the mind alone, so for God to be the greatest possible being, He must exist by necessity.
This is the first form of his argument.
Also, he argued that something that "can't be thought of as not existing" is greater than something that can, so God must exist. This is the second form of his argument.
Gaunilo put forward three challenges to the first form of the Ontological Argument.
The first was gossip - he argued that what you hear from gossip about a person may lead you to assume you know what they are like without having met them, but you can be completely wrong.
The second was defining into existence - he believes that Anselm moved from understanding the concept of God to arguing that he must therefore exist.
The third and most famous was his analogy of the island - he said that by Anselm's logic, if you were to imagine a 'perfect' island, it would have to exist as it would not be perfect if it didn't.
Anselm argued back against this, saying that you can't compare a contingent thing (the island) with a non-contingent being (God). He also argued that a being "that than which nothing greater can be conceived" is unique.
Platinga said that islands have no 'intrinsic maximum' (they can always get better), but this does not apply to Anselm's God.
Descartes compared God to a triangle, and stated that if you change the three sides or the fact that the interior angles add up to 180degrees, it stops being a triangle.
He saw 'existence' as an attribute of a perfect being. Similarly, if you take away existence from a "supremely perfect being", it is no longer supremely perfect.
This is arguing that existence is a predicate (a property) of God.
Descartes was not concerned with the mind and reality, but the definition of a perfect being.
He argued that if you don't have a 'triangle' at all, then you don't need it's attributes. He said that it is fine to dismiss the subject and the predicate together as the predicate should enhance the subject.
He also said that "existence is not a predicate" - it is not a 'quality of something' as it does not enhance the subject. This is separating the concepts of 'the nature of something' and something's existence, and said that one does not influence the other. A predicate must give us information about something, and 'it exists' does not.
He argued that it is possible to imagine something that is perfect but does not exist - so Descartes is trying to turn an analytic statement (a quality of God) into a synthetic statement (about His existence).