The first: that he be safe from being soiled.
The second: that he be safe from being seen.
It is established in the two Sahih collections, in the hadith of Hudhayfah, that the Prophet ﷺ came to a refuse heap belonging to some people and urinated standing (1).
Some scholars said that he did so to demonstrate its permissibility, while others said that he did so out of necessity (2), because the refuse heap was situated near people gathered there who could see him. If he had sat at its top with his back to them, his urine would have splashed back onto him; and if he had sat at its top facing them, his private parts would have been exposed before them. Thus, the only remaining option was for him to stand with his back to the people, so that he had a need to urinate standing.
As for the hadith stating that “he did so because of a wound in the hollow behind his knee” (3), it is weak. Likewise, the claim that he did so because the Arabs would treat knee pain by urinating while standing is weak (4).
However, it may be said that when the Arabs’ knees hurt while sitting, they would urinate standing out of necessity.