Where Was the Holy Spirit Before Pentecost

The Holy Spirit was poured out on the apostles after which they were able to do signs and wonders.

And when the day of Pentecost was fully come, they were all with one accord in one place. And suddenly there came a sound from heaven as of a rushing mighty wind, and it filled all the house where they were sitting. And there appeared unto them cloven tongues like as of fire, and it sat upon each of them. And they were all filled with the Holy Ghost, and began to speak with other tongues, as the Spirit gave them utterance.
- Acts 2:1-4 (KJV)

After that, newborn Christians were also sealed with the Holy Spirit (as a guarantee to our inheritance).

In whom ye also trusted, after that ye heard the word of truth, the gospel of your salvation: in whom also after that ye believed, ye were sealed with that holy Spirit of promise, Which is the earnest of our inheritance until the redemption of the purchased possession, unto the praise of his glory.
- Ephesians 1:13-14 (KJV)

It is the Holy Spirit that will teach us all things, and bring things to remembrance.

But the Comforter, which is the Holy Ghost, whom the Father will send in my name, he shall teach you all things, and bring all things to your remembrance, whatsoever I have said unto you.
- John 14:26 (KJV)

The Holy Spirit will be with us forever.

And I will pray the Father, and he shall give you another Comforter, that he may abide with you for ever; Even the Spirit of truth; whom the world cannot receive, because it seeth him not, neither knoweth him: but ye know him; for he dwelleth with you, and shall be in you.
- John 14:16-17 (KJV)

But the Holy Spirit was active well before that.

Men and brethren, this scripture must needs have been fulfilled, which the Holy Ghost by the mouth of David spake before concerning Judas, which was guide to them that took Jesus. For he was numbered with us, and had obtained part of this ministry.
- Acts 1:16-17 (KJV)

Even Elijah had the Holy Spirit, which is sometimes referred to as "the spirit and power of Elijah".

And he shall go before him in the spirit and power of Elias, to turn the hearts of the fathers to the children, and the disobedient to the wisdom of the just; to make ready a people prepared for the Lord.
- Luke 1:17 (KJV)

The Spirit of God was also mentioned all the way back in Genesis.

And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
- Genesis 1:2 (KJV)