St. Thomas Aquinas' position on the trinity is straightforward orthodox. There is one God (one substance) eternally in three persons. He does not distinguish between the persons in rank, though he recognizes that each have their particular functions. The distinctive aspect of Aquinas and the trinity is his explanation of how the three persons and the one substance are related. He brings up the concept of subsistence. Subsistence is the manner in which something exists. These can be temporary and contingent, e.g. H2O can subsist as ice, water, and snow, which would clearly not be applicable to the persons of the Trinity. In this case, the persons are eternal. Thus the three persons are three eternal subsistences of God.
Why use subsistence rather than existence? Aquinas wanted to avoid the contradiction that arises when somebody might say that God exists in three persons since then people might be misled into thinking that the trinity consists of one being and simultaneously as three beings. Unfortunately many people think that the trinity was revealed by God so that we should have to have faith in something irrational. In reality, the trinity was a model constructed by theologians in order to come up with a reasonable understandinging of what God has revealed.
1 being in three beings? Brrrrrrrr.--the contradiction alarm should go off. 1 being in 3 subsistences. Mmmmmm--no contradiction.