Once again, we have a situation in which one of the parties has not finished with his previous relationship. Doesn’t bode well for you unless you guys nip it in the bud right now.
When he gets back you should tell him that it was kind of embarrassing and disturbing for you to read his tweet about him being so miserable and still talking about his ex. Then ask him if he feels miserable around you, too. Then ask him if he sees a future with you. He is likely to get angry and defensive, but if he does, that is pretty much your answer.
If he tells you that he’s sorry and that he didn’t mean to hurt your feelings and that he definitely sees a future with you, then that is a much better answer. If he seems to want to continue with you, then you need to let him know that you won’t even consider it, unless he stops talking/texting/worrying about his ex. Let him know that if he needs time to work it out, then you guys should cool it for now until he does figure it out. Let him know that you understand how painful his breakup was for him, but that you need to be with someone who really wants to be with you and is completely finished with his previous relationship.
If you need to take a break, so he can figure it out, don’t get all weepy or give him any ultimatums. Just give it some sort of a time frame and tell him that after such and such a time (say a month or 2) that you guys will get together and talk and decide what to do at that point. It might be hard, but the less emotional you are when you give him this “chance to fix it” the better it will be for both of you. Then he’ll either come back and be your boyfriend or he’ll tell you that he can’t be your boyfriend because of the ex. Good luck and Ihope it all works out for the best.