We can know that the Holy Spirit is God both from his attributes (nature) and actions (function) which are inseparable in the relationship he has with the Father and the Son.In other words, we can know that the Holy Spirit is God within the doctrine known as Trinity.
The Holy Spirit
Holy Spirit ( Greek: Pneuma ” wind, breath, spirit”; Hagios ”Holy, set apart”).
The title Holy Spirit belongs to the third person in the Triune God ( Matthew 28:19).
Matthew 28:19 (NIV)
Therefore go and make disciples of all nations, baptizing them in the
name of the Father and of the Son and of the Holy Spirit,
The Holy Spirit is the one Spirit of both the Father and the Son.
John 15:26 (NASB)
When the Helper comes, whom I will send to you from the Father, that
is the Spirit of truth who proceeds from the Father, He will testify
Galatians 4:6 (NASB)
Because you are sons, God has sent forth the Spirit of His Son into
our hearts, crying, "Abba! Father!"
The Holy Spirit is a Person
The HS is a person based on the very definition of “Person” as a rational individual who has the following: mind(intellect), volition ( will) and passion ( emotion).
The Holy Spirit has a mind (Romans 8:27).
The Holy Spirit has a will ( 1 Corinthians 12:11).
The Holy Spirit has an emotion ( loves, Romans 15:30; grieves, Ephesians 4:30).
The Functions of the Holy Spirit show that He is a Person
The name of the Holy Spirit shows that He is a person.
The name of the Holy Spirit is Yahweh (2 Samuel 23:2-3; Matthew 28:19).
Premise 1: Yahweh is a person.
Premise 2: The Holy Spirit is Yahweh.
Conclusion: Ergo, the Holy Spirit is a person.
Other biblical proofs that the Holy Spirit is a person:
Can be blasphemed - Matthew 12:39
Contrasted with evil spirits - Mark 3:22-23; Matthew 12:32; 1 Timothy 4:1; 1 John 3:24-4. If "unholy or evil spirits" are persons, then the Holy Spirit is a person.
In Revelation 22:17, both The Spirit and the Bride say "come." This verse clearly equates the two as persons who uttered a same invitation.
The Holy Spirit is God
The Holy Spirit is identified as ‘God’ in Acts 5:1-10 , John 3:5-8 and 1 Corinthians 3:16.He is identified as 'Yahweh'(Jehovah) in 2 Samuel 23:2-3 and Matthew 28:19.
The Holy Spirit is God by nature. He has all the complete divine nature:
Eternality ( Hebrews 9:14)
Omniscience ( 1 Corinthians 2:10).
Omnipotence ( Jb 33:4, Psalm 33:6).
Omnipresence ( Psalm 139:7-8)