The phrase, "Sons of God” first appears in the King James version, in Genesis 6 and it refers to God's people. If you look at Genesis 4, you will see that in verse 26 "men began to call upon the name of the LORD." The alternative translation in the margin notes that the Hebrew actually says that they called themselves "by the name of the LORD" i.e. "sons of God." There was a sharp demarcation between the two communities, the "sons of God" and the "sons of men."
There is such a demarcation today - see 2 Corinthians 6:14-18. Note that the phrase "sons of God" in the New Testament always refers to believers. See John 1:12; Romans 8:14; Philippians 2:15; 1 John 3:1,2.
In Genesis 6, the community of the faithful joined themselves to the community of the flesh (marrying the daughters of "men" - i.e. "the sons of men", a community characterized by greed, idolatry, immorality, and violence. The community of faith sank to the lowest common denominator and was corrupted. Only one family remained faithful - Noah's family. We know what happened to those who joined themselves to the world and left the family of faith. They perished. The door to the ark of safety was closed to them.
What of us? We do well to heed the example of Noah and the words of the Lord Jesus when he said Matthew 24:26,27 - "And as it was in the days of Noah, so shall it be also in the days of the Son of man. They did eat, they drank, they married wives, they were given in marriage, until the day that Noah entered into the ark, and the flood came, and destroyed them all." Let's be sure to be among "the sons of God" in the ark of safety when our Lord returns!
I hope you have found this helpful.