Let's review. What you are trying to express is:
John lost his friend. John was crying for his friend.
Of course, such repetition is undesirable, so English has a tool you can use, called a relative-pronoun. Relative pronouns include who, whom, that, and which. Of those choices, who and whom can be used to refer to people. Who is used for subjects; whom is used for objects.
You probably know all that already, but just need advice in applying the rules.
The pronoun you want is the one in the objective case (whom), because John lost his friend. (Using the subjective case pronoun who would mean that the friend lost John, which is not what you want.)
Remember, also, that relative pronouns help you refer to a noun that would otherwise be repeated. Relative pronouns don't stand alone. The correct sentence should be:
John was crying for the friend whom he lost.
That said, even native English speakers often fail to distinguish between subjective and objective cases correctly. Therefore, you have to be careful about parroting patterns that you see and hear, as you may be copying incorrect examples. On the other hand, you are also unlikely to be stigmatized for choosing the wrong case in everyday speech.