The word behind the doctrine is breath. The Hebrew ruach is the wind of God moving over the waters in the first lines of Genesis, the breath that makes the dry bones live in Ezekiel, and the spirit that comes upon judges and prophets so that they speak what they did not have in themselves to say. Second Temple and rabbinic Judaism spoke of the ruach ha-kodesh, the spirit of holiness, above all as the spirit of prophecy, and its departure was one way of describing the closing of the prophetic age.
The Christian scriptures take up the term at every turning point of their story: the Spirit overshadows Mary, descends like a dove at the baptism of Jesus, drives him into the wilderness, and is poured out on the assembly at Pentecost in wind and fire. John's gospel adds the most personal language of all, the Paraclete, the advocate and comforter who will remain when Jesus has gone. It took the church three centuries to decide what this amounted to.
The creed of Nicaea in 325 ended almost abruptly with "and in the Holy Spirit", and in the two generations that followed, those who denied the Spirit's full deity, remembered as the Pneumatomachians, the spirit-fighters, forced the question. Basil of Caesarea answered them without ever calling the Spirit God outright, arguing instead from the church's worship: the Spirit is glorified together with the Father and the Son. The council of Constantinople in 381 wrote exactly that caution into the creed still said today.