Most likely the first human who invented the first god was some smart tribal guy who saw that it was a very effective way to protect himself from bodily harm by the stronger ones if he made them and the less smart members of his tribe believe he had a very strong friend living across the mountains. A friend so strong that he could make the mountains rumble by stamping his feet on the ground. Others would not dare to attack him fearing the revenge of such a powerful friend and even though no one ever saw this friend it was better to be safe than sorry.
It probably did not take long for this smart guy to discover that his fellow tribesmen were easily led to believe that this thunder ally would make them nearly invincible in battle with rivaling tribes and could even conquer these tribes. The smart guy was well aware that in reality he was not safe at all so he turned to the strongest one around, usually the tribe leader and made him believe that he was favored by the mighty thunder-friend across the mountains.
As history progressed the tribal leaders became the Kings of the later times where the smart guys became the holy men, and priests.
Of course the strong friend story was revised when people could cross the mountain and were likely to find nothing there. As time passed the powerful friend moved to a place where no man could travel, places like in the sky, the deepest sea, or the top of unclimbable mountains.
Religion became the most powerful way of making people compliant and even the Roman Empire saw that its culture of countless god families would not work if they wanted to maintain power over Europe. In the 4th century Emperor Constantine the Great started a change when he decided to go for a new approach that seemed to work in the eastern territories so he threw out the old God families with their immensely complex mythical stories and started simplifying things by adopting the one single god of the Jewish culture combined with folklore about a prophet who claimed to have been the son of this Jewish god; this was a wise decision because in this way he would not cross the Jews, who he saw as a nuisance and wished he could get rid of.
He appointed a group of smart guys, that you will find in any era, and gave them the task of creating this system of a Father, a Son and a Mother who was chosen to bare this son of God, Jesus.