It's noble of you to help a friend in need, and it's hard to ask friends for help when you really need it, but six months is entirely too long to have a houseguest. At that point, he'd officially be a roommate and would need to be pulling his own weight. And really, if he can't pull his life together in that amount of time, then it's time to start questioning his motives.
If you're going to have him staying with you for longer than a week, you need to lay out ALL the ground rules - cooking, cleaning, applying for jobs, interviewing, eventually repaying you for utilities and food, etc. Make it clear to him that he will not be allowed to sit on your couch all day watching TV. He will leave the house when you and your girlfriend do, and he can return when you're both home for the day. Yeah, it's kind of parental to have to do this with your friend, but his life is the one in disarray and he's created a situation where you have to parent him. If you're going to be feeding him and putting a roof over his head for any length of time, he needs to respect your home and abide by your rules.
You should work these rules out with your girlfriend ahead of time, and if you're serious about this girl, then you need to give her the absolute power to say when he needs to go, or if he can even stay with you guys at all. You may be his best friend, but you're not his only friend. He'll find other couches to crash on.
And know that no matter what, at this point your friendship has already been affected by this. It's up to you and him to determine how the future of your friendship will turn out. Best of luck to you.