The rule is that everything that begins to exist must have a cause. Nothing comes into existence by itself. The emphasis in that rule is on “begins to exist”. God didn’t. He has always existed, since before the word “always” even had meaning.
That is impossible for us (for me, anyway) to completely wrap our head around. We are so bound by time. Even when we think of “forever”, we really end up just thinking of a really, really long time. Totally infinite time just doesn’t compute.
Neither does the idea of “outside” our universe. When we try, Star Wars style, we just end up with a more extensive version of what we already have. God is more “other” than that, beyond anything we can imagine. (The Bible’s usual word for that is “Holy”.) It’s as if we are flat, two-dimensional creatures trying to understand a cube. We don’t have the capacity to think beyond a square.
The closest I can come is to think about the relationship between the author of a book and the characters inside that book. Even if the characters were self-aware, it would only be within the context of the book. They would be unable to even conceive of the author’s world. They are too bound by the setting and plot the author designed for them.
We are bound by our setting in time and space. God, as our Author, is not. Before there was such a thing as our time or space, He was there. In fact, He is the source of our space and time. Without Him, there would be no universe. But He would still be there!