Determining the sex of a five-month-old Shih Tzu can be done by observing the presence of testicles and their urination posture.

One way to identify the sex of a five-month-old Shih Tzu is by checking for testicles. They typically become very noticeable around three to four months of age. You can also observe the location of their penis; if it's on the abdomen, it's a male, and if it's closer to the rear, it's a female. Specifically, a male puppy's penis is located on its belly, relatively far from the anus, while a female's penis is very close to the anus, not near the belly button, and female puppies have noticeable nipples on their belly. This is generally the most reliable method.
Furthermore, when puppies are very young, their leg muscles are not strong enough, so both male and female puppies will squat when they urinate. However, around 3-5 months old, male puppies will start lifting one leg when urinating against objects, whereas females will continue to urinate in a semi-squatting position. While this posture is not a definitive method, it can be a helpful reference point.