The indwelling of the Holy Spirit was a promise made in the New Covenant.
Until that covenant was in force, the Holy Spirit would come upon and depart from a person as seen in the Old Testament.