A couple questions come to mind right away.
Are you the same sex and just friends? If the answer is yes, then the Soldier needs to check his housing contract about having permanent guests living in the quarters with them. From my experience, there is a clause in most housing contracts that prevents this. There are exceptions for family members visiting for a lengthy period of time. From a UCMJ standpoint, there is nothing wrong with this. However, you would still be required to maintain your room in the barracks.
If you are not the same sex I would highly discourage this idea. Assuming that you are not romantically involved, the fact that you are living there could present a perception of an inappropriate relationship regardless of your ranks.