Sons of God in the Old Testament.
In the Old Testament the phrase “son(s)/children of God” designates three types of persons:
The heavenly beings who met with the Lord in the divine council:
Job 1:6, "Now there was a day when the sons of God came to present themselves before the Lord, and Satan also came among them."
Job 2:1, "Again there was a day when the sons of God came to present themselves before the Lord, and Satan came also among them to present himself before the Lord."
At the moment of creation we are told that “the morning stars sang together, And all the sons of God shouted for joy?” (Job 38:7).
The people of God are called “the children of the Lord your God.”
Deuteronomy 14:1, “You are the children of the Lord your God; you shall not cut yourselves nor shave the front of your head for the dead."
Hosea 2:1, "Say to your brethren, ‘My people,’ And to your sisters, ‘Mercy is shown.’ "
Isaiah 45:11, "Thus says the Lord, The Holy One of Israel, and his Maker: “Ask Me of things to come concerning My sons; And concerning the work of My hands, you command Me."
They became God’s children through creation and redemption, "Then you shall say to Pharaoh, ‘Thus says the Lord: “Israel is My son, My firstborn. So I say to you, let My son go that he may serve Me. But if you refuse to let him go, indeed I will kill your son, your firstborn” (Exodus 4:22-23).
Finally, the Israelite king was called the “Son of God.”
2 Samuel 7:14, "I will be his Father, and he shall be My son. If he commits iniquity, I will chasten him with the rod of men and with the blows of the sons of men."
God appointed the king as “my firstborn”
Psalm 89:27, "Also I will make him My firstborn, The highest of the kings of the earth."
Psalm 2:7, "I will declare the decree: The Lord has said to Me, ‘You are My Son, Today I have begotten You."
In these cases the word “son” is used figuratively. Heavenly beings are sons of God through creation; the people of God are God’s children through creation and redemption; and the king becomes a son of God through his appointment as king. In the Bible God does not have children through natural conception and birth.