1 Corinthians 2:11 (ESV)

11 For who knows a person’s thoughts except the spirit of that person, which is in him? So also no one comprehends the thoughts of God except the Spirit of God.

In order to make the role of the Spirit clearer, Paul draws an analogy with the human spirit. The word spirit here is used in the sense of soul, the inner life of a person. Just as the spirit of a man knows his thoughts, so the Spirit of God knows God’s thoughts.

Paul is not claiming that the Holy Spirit is God’s soul. The purpose of the comparison is to draw attention to the intimate knowledge that the Spirit (being God himself) has of God.