What is the biblical basis for the personhood of the Holy Spirit? According to Trinitarian theology, the Holy Trinity consists of three persons (τρεῖς ὑποστάσεις), the Father, the Son, and the Holy Spirit, who share the same essence/nature (ὁμοούσιος). What is the biblical basis for the personhood of the Holy Spirit (i.e., that the Holy Spirit is a "person")?
Here are four common defenses of this doctrine:

The masculine pronoun in Greek is applied to the Holy Spirit even when not required by Greek grammar
The Holy Spirit is shown to be in a coordinating relationship with other persons, such as the Father and Son, as well as humans, suggesting that he also is a Person
The Holy Spirit has personal attributes and performs personal activities
Biblical distinctions between the Holy Spirit and the &quot;power of God&quot;

Masculine pronoun applied to the Holy Spirit
There are several places in the Gospel of John where the masculine pronoun he (Greek ekeinos) is apparently applied to the Holy Spirit, despite the Greek word for spirit being neuter (pneuma).  Many modern scholars have taught that such examples are evidence for the personhood of the Holy Spirit.1  For example, John 14:26:

But the Helper, the Holy Spirit, whom the Father will send in my name, he will teach you all things and bring to your remembrance all that I have said to you. (ESV, emphasis added)

Other examples of this are John 15:26 and especially 16:13–14.  However, some trinitarian scholars reject this argument as specious, saying that the rules of Greek grammar are not controverted in these verses: the masculine pronoun, they argue, can legitimately refer to the masculine noun Helper, not Spirit, even though (particularly in John 16) they are not in close proximity.2
Relationships with other persons
A number of passages indicate that the Holy Spirit is in a coordinate relationship with the Father and Son.  Thus, if they are Persons, then so is the Holy Spirit.  For example, Matthew 28:19:

Go therefore and make disciples of all nations, baptizing them in the name of the Father and of the Son and of the Holy Spirit. (ESV)

Other examples of this include 1 Cor 12:4–6, 2 Cor 13:14, Eph 4:4–6, and 1 Peter 1:2.
The Spirit is also presented in parallel with human persons (the Apostles) in Acts 15:28:

For it has seemed good to the Holy Spirit and to us to lay on you no greater burden than these requirements (ESV)

The Gospel of John also indicates that the Holy Spirit is distinct from the Father and Son, through its language of the Father (John 14:16) and Son (John 15:26) sending the Spirit:

And I will ask the Father, and he will give you another Helper (John 14:16, ESV)

The word &quot;another&quot; in this verse, plus the application of the same Greek word for Helper (parakletos) to Jesus in 1 John 2:1, further establishes the personhood of the Holy Spirit by indicating that the Holy Spirit's role mirrors that of Jesus in this significant respect.
Personal attributes and activities
The Holy Spirit is seen having attributes and performing activities commonly attributed to persons.  For example, he is called the Helper or Counselor and performs the activity of bearing witness in John 15:26:

But when the Helper comes, whom I will send to you from the Father, the Spirit of truth, who proceeds from the Father, he will bear witness about me. (ESV)

The &quot;Helper&quot; language is also used in John 14:16 and 16:7, and scholars argue that this word cannot be considered to be merely &quot;the name of any abstract influence.&quot;3
Other personal activities performed by the Holy Spirit include:

Teaching (Luke 12:12)
Interceding (Romans 8:26–27)
Having a mind of his own: (Romans 8:27)
Searching the depths of God (1 Cor 2:10)
Knowing the thoughts of God (1 Cor 2:11)
Distributing gifts (1 Cor 12:11)
Forbidding activities (Acts 16:6–7)
Speaking (Acts 8:29, 13:2)
Evaluating actions (Acts 15:28)
Being grieved (Isa 63:10, Eph 4:30)

Among these, Romans 8:27 and 1 Corinthians 12:11 make it particularly clear that the Holy Spirit has a mind and will: attributes of personhood.
Not simply the power of God
Finally, it is widely argued that the Holy Spirit being merely the &quot;power of God&quot; doesn't make sense in light of verses like Luke 4:14:

And Jesus returned in the power of the Spirit to Galilee (ESV)

If the Holy Spirit is the power of God, then this would read, &quot;And Jesus returned in the power of the power of God to Galilee,&quot; and the first &quot;power&quot; would be redundant. Other examples of this include Acts 10:38, Rom 15:13, and 1 Cor 2:4.
Summary
The first of these four arguments is certainly the weakest, though some scholars who interact with the counterargument still maintain it with respect to at least John 16:13–14.  Nonetheless, defenses of the personhood of the Spirit most safely rest on the biblical evidence of the Holy Spirit's relationship with other persons, his personal attributes and activities, and indications that he is not merely the &quot;power of God.&quot;

This presentation is largely an expansion of Louis Berkhof's Systematic Theology, 1.1.8.  Other helpful resources include Wayne Grudem's Systematic Theology, chapter 14 and Charles Hodge's Systematic Theology, 1.1.8.1.

A huge number of scholars have made this argument, including Berkhof, Hodge, and Grudem in the sections mentioned above.  An extensive list is also contained in the paper referenced below, beginning on page 67.
Naselli and Gons, &quot;Prooftexting the Personality of the Holy Spirit,&quot; DBSJ 16 (2011).  The analysis of the common argument begins on page 79.  A list of adherents to the counterargument begins on page 83.  An example of a theologian interacting with the counterargument and rejecting it is found on page 87.
The quote is from Berkhof, 1.1.8.