The Bible primarily is a book about the redemption of man; and as such, there are certain topics that are not exhaustively covered (Deut. 29:29). One such topic is what happened prior to "in the beginning," Genesis 1:1.
However, we are not without clues and what we do know includes the following:
- There is only one eternal being (the Triune God) (cf. Psalm 90:2).
- He has the attribute of aseity (life in of Himself/not derived from anything else/self-existent) (cf. John 5:26).
- That all of creation was made after some time point--rather after time was created! (cf. Genesis 1).
- Another verse that will help us with this question is John 17:5, "Now, Father, glorify Me together with Yourself, with the glory which I had with You before the world was."
Therefore, we can summarize that before "in the beginning"/creation of all things, the Father, Son, and Holy Spirit existed in perfect communion together in their full glory and had a form of fellowship that we cannot comprehend.