hi all! does anyone know the name of this drama? it's about a man who turns out to be gay so he starts a relationship with another guy, then his ex-girlfriend turns out to be pregnant so he goes back to her to raise the child. then like after 4 years the two guys start their relationship again and raise the child together.

Uhm, the storyline of HIS is similar - gay couple Shun&Nagisa at a certain point break up, Nagisa starts a "normal life" and has a daughter but he misses Shun so he goes back to him with the daughter.
There's a drama depicting their life when they're young and a movie about this return/daughter part (and a new movie is scheduled to come out soon I think).

His (2020) - MyDramaList 

thank you :) im going to watch it right now. hopefully, this is the one.

just finished it. it wasn't the drama i was looking for. but worth the tears! the drama i recall that they had been longtime friends, the guy was a closeted gay, he broke up with his girlfriend, started dating his friend, and then the ex-girlfriend tells him at his house that she is pregnant, the boyfriend overhears the conversation, the dude decides to stay with the woman for a couple of years, then comes back to the former boyfriend. he and the boyfriend raise the son (i believe its a son) together.

Don't know if you're still looking for that drama, but I stumbled across another "same topic" movie by coincidence XD
So I just thought I'll let you know :D

Check this one, Thai movie Present Perfect (2017) - MyDramaList  and the sequel. Present Still Perfect (2020) - MyDramaList 
Same plot but starting off from strangers and then a son arrives and then... much love! XD

found it. it was love by chance 2. the side couple.