When he feel alone he will remember you because he may not have any other friends to miss. If he is busy or he feel happy he will never recognize your existence. If he fall in love with you he should always be occupied with you.
In summary, "寂寞的时候会想起你" = He has not fallen in love with you but he definitely 会想起你 when he is in bed alone.