Last Sunday was Trinity Sunday in the Christian calendar, and the concept of a Triune God raises difficult theological questions. Many attempts have been made to explain it. Bishop Robert Barron discusses three attempts in this 14 minute homily:
The problem of course, is trying to explicate how one God can exist as three persons when none of the persons is identical to the other. The classic Christian view is represented by this diagram:
To many non-Christians, and even some Christians, this concept is hard to distinguish from polytheism. If the Father is God, and the Son is God, and the Holy Spirit is God, that sounds a lot like three Gods.
I personally think that God has revealed much about Himself in His creation and am therefore drawn to theological metaphors and analogies from the created world. One that I think captures what it means to be three persons in one substance is water.
Water is one substance, H2O, but it manifests itself in three different states - solid ice, liquid water, and gaseous water vapor. Moreover, all three states can exist simultaneously at 0° Celsius, and they can transition between states, in a fashion that may be analogous to communion within the Trinity.
Some object that this analogy is a heresy called Modalism because it seems to deny the "is not" relationship in the above diagram, but I'm not sure this is so. Ice is not identical to vapor. Liquid is not identical to solid ice. These states behave differently, they have different physical properties and thus have different identities even though they are all the same substance, much like the three persons represented by the diagram.
Anyway, the nature of the Godhead has perplexed far greater minds than mine, and I certainly don't profess to have the definitive answer to the question. Even so, as Thomas Aquinas taught us, analogies can be helpful in at least gaining partial understanding of a truth, and perhaps the analogy to one of the most amazing of God's creations, water*, will be helpful to you.
* See biologist Michael Denton's excellent book The Wonder of Water. It will leave you amazed at this substance that we so easily take for granted.