William Lane Craig sets Leibniz' cosmological argument as follows (Cosmological Argument, 274):
1. Something exists
2. There must be a sufficient reason or rational basis for why something exists rather than nothing.
3. This sufficient reason cannot be found in any single thing or in the whole aggregate of things or in the efficient causes for all things.
a. Things in the world are contingent, that is determined in their being by other things such that if matter and motion were changed, they would not exist.
b. The world is simply the conglomeration of such things and is thus itself contingent
c. The efficient causes of all things are simply prior states of the world, and these successive states do not explain why there are any states, any world, at all.
4. Therefore, there must exist outside the world and the states of the world a sufficient reason for the existence of the world.
5. This sufficient reason will be a metaphysically necessary being, that is, a being whose sufficient reason for existence is self-contained.
Premise one is undeniable; for in order to deny the existence of something, one must first exist. Thus, such a denial would be self-defeating. Likewise, in order to affirm the existence of something one must exist. Leibniz is making an affirmation here. Thus something certainly exists.
Premise two is a bit ambiguous. What does Leibniz mean by rational basis? It seems to me that this premise can be taken in two ways. Either it means that there is a knowable explanation for why the "something" from premise one exists or it means that there is a purpose for its existence. I think that taking "rational basis" in the second way will explicitly beg the question for the existence of God. However, there is a sense in which taking the premise in the first way implicitly begs the question—since it assumes an order to the universe. And order is not a given in a materialistic world. Nonetheless, to be charitable, I will grant that the order of the universe is a brute fact and allow the second premise on the first understanding, that "rational basis" applies to our ability to know the efficient (material) cause of something, rather than the purpose.
But then we find that Leibniz, in premise three, tells us that the reason cannot be found in the order of efficient causes. Thus his "rational basis" is premise two must be an appeal to a purpose. But this seems to beg the question. You cannot have a purpose without having an intelligent agent. Thus the very assumption that a purpose is a necessary condition for existence implies a necessary intelligent agent, or God.
Thus the rest of the argument put forth by Leibniz is mute. The whole "proof," since it relies on this assumption, fails.