Unlike the indwelling of the Holy Spirit at the time of the Spiritual Baptism that Jesus taught that is permanent, the Holy Spirit in the days before Messiah come was not permanent, but a sign of God's favor upon individuals like Joshua, Numbers 27:18, David, 1 Samuel 16:12-13, Saul, 1 Samuel 10:10, as the Holy Spirit came upon them. If God's favor left a person the Holy Spirit would depart from them like in Saul's case.
In the book of Judges the Holy Spirit came upon various judges whom God raised up to deliver Israel from their oppressors. I could give you all kinds of accounts where the Holy Spirit fell on or indwelled many OT people as the Holy Spirit performs much of the same functions in the OT as we see in the NT until the end of days. The only difference is the permanent indwelling in believers now through the Baptism of the Holy Spirit.
Eleven roles of the Holy Spirit in the OT:
1. The Spirit created and sustained life - Genesis 1:1-2; Psalms 104:30; Job 33:4
2. The Spirit spoke God's word - Isaiah 59:21; 2 Samuel 23:2; Deuteronomy 30:14
3. The Spirit Promoted Holiness - Genesis 6:3; 6:5-6; Isaiah 63:7-10; Psalms 51:11; 1 Samuel 15:23; 2 Samuel 12:13; Psalms 139:7
4. The Spirit addressed evil - Genesis 6:3; Micah 38
5. The Spirit regenerated - OT believers were regenerated by the Spirit because all believers who are of faith must be regenerated to overcome their natural hostility towards God and be able to please Him and by faith were regenerated as OT saints looked forward to the coming of Messiah- Romans 8:7-9; Romans 4:1-5
6. The Spirit indwelled, but only temporarily in the OT like that of Joshua, Numbers 27:18, David, 1 Samuel 16:12-13, Saul, 1 Samuel 10:10
7. The Spirit empowered - Haggai 2:5; Zechariah 4:6; Judges 14:5-6; 15:14
8. The Spirit taught and led - Nehemiah 9:20, 30; 1 Chronicles 28:10-12; Job 32:8; Psalms 143:10
9. The Spirit granted special skills - Exodus 31:1-5; Genesis 41:1-38; Numbers 11:25; 2 Chronicles 24:20; 1 Samuel 16:13
10. The Spirit pointed to Messiah - Isaiah 42:1
12. Holy Spirit will teach you all things God wants us to lean and will bring those things back to our memory, Jon 14:26