The answer is "he felt as lonely as a cloud that has nowhere to go." or the second option. Using context clues you would see that clouds usually travel wherever the wind takes them and if a people are lonely and they are thinking themselves as if they are a cloud that is wondering through the sky nowhere to go would be the meaning of this paraphrases 'lonely as a cloud' since how clouds travel but they are going nowhere.
Hope this helps!