John 7: 39
But this He spoke of the Spirit, whom those who believed in Him were to receive; for the Spirit was not yet given, because Jesus was not yet glorified.
Jesus was speaking to a crowd and teaching them of the things to come. In fact, he was teaching them about the Holy Spirit. This statement indicates that the Spirit is to be received. In other words, He is a gift and those who wish to receive the gift shall have it. But the Holy Spirit is not going to be forced on those who are unable to receive Him. There is the element of choice on the part of the recipient. The Holy Spirit is for all who choose to receive Him. Receiving Him is not automatic. You have to make your own choice. Not even God is going to make it for you though Jesus did command His disciples to remain in Jerusalem and await the gift of the Holy Spirit which makes it clear that His intent is for us all to receive the gift.
We also learn who is eligible to receive this gift. The gift is for those who believe in Jesus. That is the only requirement. If one truly and honestly believes in Jesus as the Messiah, the chosen one of God, then that person is eligible to receive the long-awaited gift of the Holy Spirit.
We also see in this passage the timing of the pouring out of the Holy Spirit. The Spirit had not yet been given because Jesus had not yet been received into glory. We know that during the 40 day period between when Jesus arose from the dead and when He ascended to the Father He appeared to His disciples. One of the things Jesus told them was to await the promise of God because they would receive “the Holy Spirit not many days from now” (Acts 1: 5). Shortly thereafter Jesus ascended to heaven to be seated at the right hand of God after which, the Holy Spirit was sent into the earth to be with us for all time.