According to Aquinas but not originally, I'm not exactly sure whose theory it was that Aquinas reworded.
- There is an efficient cause for everything; nothing can be the efficient cause of itself.
- It is not possible to regress to infinity in efficient causes.
- To take away the cause is to take away the effect.
- If there be no first cause then there will be no others.
- Therefore, a First Cause exists (and this is God).
Premise 1 is unjustified and also inconsistent with there being a First Cause, because a First Cause by definition would not be caused by anything else.
Premise 2 is unjustified.
Premise 3 is the fallacy of denying the antecedent. From Cause -> Effect it is fallacious to conclude ~Cause -> ~Effect. For example, suppose an executioner caused a prisoner's death. From this we cannot conclude that had that executioner not been there, the prisoner would not have died; another executioner could have done the job instead.
Edit: Here's an alternative presentation of it that makes a bit more sense. From https://www3.nd.edu/~jspeaks/courses/mcgill/201/aquinas-cosmological-argument.html
- Everything which has come to exist has been caused to come to exist.
- Nothing which has come to exist can be the cause of its own existence.
- Everything which has come to exist is caused to exist by something other than itself. (follows from 1,2)
- It is impossible for a chain of causes of this kind to go on to infinity.
- There must be a first cause, which causes other things to come into existence but did not itself come into existence. (follows from 3,4)
The conclusion 5 would almost follow from the (unjustified) premises, if we interpret premise 2 to rule out causal cycles of any size (time flowing in a circle). However, more than one first cause (a thing that did not itself come into existence but causes other things to do so) are also possible from these premises.