how was the relationships between gilgamesh and the gods
In the ancient times, mortal men had more of a "servant-master" relationship with their Gods; the Gods did not pay them much attention and treated them as animals. However, just like with many Greek Epics, those who were born of a God had a much stronger relationship with them, and a greater hand in the affairs of the Gods. As you know from the Epic of Gilgamesh, Gilgamesh, King of Uruk, was born of the Goddess Ninsun (daughter of ANU, the main God in heaven to those of Mesopotamia). Most demigods, such as Hercules and Odysseus were born by a male God having intercourse with female mortals. Gilgamesh however, was born of a Goddess, making him "2/3 divine" instead of one half divine (bestselling author Zecharia Sitchin explains this by noting that the mother, and the mother alone gives the child Mitochondrial DNA along with the 23 chromosomes). Gilgamesh spoke with the Goddess Ninsun constantly and wailed to her that since he was mostly a God, he should possess the immortality of the Gods.
Gilgamesh was put into power at a leading cult-center of Mesopotamia, so his actions were constantly on the radar of the Gods who bestowed kingship to him. Some Gods loved Gilgamesh, and others began to hate him. The Goddess Ishtar (who is very sexually active as we see in other Sumerian Epics) attempts to have a sexual relationship with Gilgamesh, who refuses. This scornful rejection by a mortal man enrages Ishtar who seeks to have him put to death. When Gilgamesh and Enkidu defile the Bull of Heaven, Ishtar was the first to call to Anu in the heavens and plead with him to deal with Gilgamesh.
As we see from the story, no matter how divine Gilgamesh was, he could still never become an equal to the Gods. His relationship with them made other mortals jealous, but on the other hand, Gilgamesh's relationship to the Gods was one of jealousy.