Because of the conflicting considerations and ambiguities surrounding this fundamental issue, people have adopted the three possibilities mentioned in the question. Each has been upheld by groups of people, both Muslims and non-Muslims.
The first possibility:
This is the position of those who say that He created His creatures and prescribed His commands for no reason, motive, or impetus, but solely by His will and sheer volition. This is the position of many speculative theologians, jurists, and others who affirm divine decree and profess adherence to the Sunnah. Groups among the followers of Mālik, al-Shāfi‘ī, Ahmad, and others have held this view. It is also the position of al-Ash‘arī and his followers, and of many Zāhirī “opponents of analogical reasoning in jurisprudence,” such as Ibn Hazm and others like him.
One of their arguments is that if He created creation for a reason, He would be deficient without it and acquire perfection through it. For, with respect to Him, either the existence and nonexistence of that reason are equal, or its existence is preferable. If the former is true, He cannot act for its sake. If the latter is true, then its existence is established as preferable for Him; He would therefore acquire perfection through it and would consequently have been deficient before it.
Another of their arguments is what the questioner mentioned: if the cause were eternal, the effect would necessarily have to be prior as well. For although the final cause precedes the effect in knowledge and intention—as it is said, “What comes first in thought comes last in execution, and what comes first as a goal comes last in attainment,” and it is said that the final cause is what makes the agent an agent—there is no doubt that, in actual existence, it comes after the effect. Thus, whoever performs an act