It takes a lot of time, for one thing.
Just the right amount of military might, influence, trade routes, kissing up, luck...
No one knows for sure. The devs say that trade will get you there, yet I have achieved a close relationship without any trade routes being established.
And sometimes, no matter how many trade routes there are, the civ just will not get past friendly.
I am in a game now where I am allied to 3 civs, and have 2 that are still only friendly.
Still working on that one, and it is the year 2233 so far. All the civs are allied to 3-4 others now, except for the Arceans. I am their only ally thus far.
One cool thing about this stage of the game - when anyone declares war it will turn into a galactic war.