Homosexuality in its self a big sin. Allah SWT destroyed Lout people, because of this abnormal relation. However, what I understood from your first question is that if a normal guy hugged a homosexual guy in friendship manner, while the other party feels beyond that sexually, then is it permissible for the normal guy to hug the gay or not? If this is correct, then we have two scenarios: 1- He knows that the other party is gay, and will be sexually aroused, then, it is not permissible to do any thing could lead to this result. 2- He does not know, then, it is not haram, even if it lead to arousal. Second question: With regard to being roommates, this is haram for sure, because they will definitely practice sodomy or lesbian. As for other acts, If they know or have the probability that such acts would lead to haram acts, then, it is haram. Otherwise, it is OK.