(This went long, sorry about that. Summation at top, details at bottom.)
Similar environments and somewhat similar evolutionary histories will produce parallel forms. On most Earth-like worlds, the same forces that shaped humans and all our ancestor species will also more often than not produce "humanoids" as a tool-using species. Not Star Trek, "just-like-humans-except-the-nose" humanoids but bipedal, feet at the bottom, arms or arm analogs towards the top and a head with a big brain at the top.
Since most niches on a terrestrial world require movement, linear body plans have an innate head start in filling most niches. That is physics. Despite the randomness of variation, linear body plans are easier to adapt to movement niches than radial body plans because fewer variations are needed. Once linear organisms dominate more niches, they have more innate variation and thus subsequent species are easier to generate when new niches open up. The linear plan and its generic template becomes core to a larger number of species and subsequently harder to change radically. It's easy to tweak a linear form to shoehorn it into a niche than convert a linear form to a radial or add all the needed variations to a radial.
For a linear body plan, a humanoid body plan is the easiest to evolve to free up limbs from movement to manipulation.
Therefore, rough humanoid shapes are statistically more likely than non-humanoid on Earth-like worlds.
People forget that the only random part of evolution is the production of variation. Selection, the other part of evolution is the utter opposite of random. In selection, the environment compresses a species into a specific shape using variation as "lubricant" (by analogy.)
This means that similar environments develop similar forms regardless of evolutionary history. On Earth this is called parallel evolution. The canonical example is the mouth shape of the flamingo begin a near exact small scale replica of the mouth shape of baleen whales even though they share no history of having similar mouths. Why? Because they're both filter feeders of microscopic organism in water and they both have hinged jaws. That shape is the most efficient. It's physics at that point, not biology.
If we went to another planet, found an animal with hinged jaws eating the same way, they'd have the same mouth shape.
The same applies to all evolution in similar environments. The fact that the environment is on a different planet is irrelevant.
On any Earth-like planet, physics will dictate two primary body plans, the radial and the linear. Radial body plans are better for animals that are primarily sessile, like anemone, which move slowly usually while actively attached to the surface, like starfish, or which move in line with gravity, like jellyfish. Any animal that moves perpendicular to gravity, without attachment and must do so efficiently will have a linear body plan e.g. rotifers, crabs, fish, reptiles, birds, mammals.
These body plans are laid down very early in evolution history and are encoded in the most core of our genes. Their close fit with optimal physics is what has kept them around for billions of years.
Most animals on Earth have a linear body plan. (Just like technological vehicles, which aren't based or inspired by biology.) That body plan presents the minimum forward surface area for resistance in water, earth or air. Sensing is clustered in the primary direction of movement. Control projections (limbs are at the bottom in water, earth or on land because gravity provides a control vector of its own. Aerial creatures reverse this by hanging from wings at the top, since they have no buoyancy.)
So, on every Earth-like world, any creature that moves pretty much at all, in any environment will have a linear head-tail and a top-bottom basic layout. All but aerial forms will have their control surfaces on the bottom. On land that will mean bellies or limbs. It will be a very common pattern because of the physics.
Once you start with a linear body plan, the evolution towards a bipedal humanoid becomes easy and arguably the easiest option to create a tool-using species.
On land, the lack of bouyance for support control and the advantage of low frictions mean that limbs that lift the animal off the ground have a significant energy advantage. But the trade off is that limbs require a lot of information processing. The hardware of limbs without the software isn't very useful.
The easiest system is a vast number of small weak limbs, each supporting a small amount of weight and moving in a simple repeated motion itself triggered by a signal from adjacent limbs. That's how millipedes (evolutionarily very old) work. What passes for their brains just sends signals like start, stop, forward, reverse, to the first leg on either side and the legs automatically do the rest.
Not a very flexible system. Millipedes quite often run off edges or plow into obstacles because the back legs don't stop moving in time.
Controlling each leg individually is better, if you have the brains to do so. The next step up is few legs, better controlled. The simplest system there employs two intermeshed tripod. A tripod always sets firmly regardless of the terrain so one tripod is always set firmly, then the second lifts and positions itself firmly, then the first tripod lifts. Repeat the sequence and you have the motion of a six-limbed insect. It's likely we will find six-limbed insects or insect-scale critters to be quite common.
Arthropods, with eight or more limbs, evolved underwater from millipede-like forms. Their control systems are slightly less sophisticated than insects so they still have more than six limbs that operate in a semi-cascade. The evolutionarily younger arthropods, usually walk insect-tripod style and task the extra limbs to some other function e.g. web spinning or swimming.
Land vertebrates didn't evolve from insects but fishes. Legs evolved from fins while still underwater to provide anchoring for immobility for hiding and hunting. Fish need four control vectors on the bottom so all land animals start with four limbs and a tail. But the basic physics of the tripod still applies.
At larger scales, the biomatter gets less relatively rigid so a strict tripod doesn't work. Again, more computational power solves the problem. Reptiles that walk use shifting tripod with three planted limbs and one moving one. Each limb/foot spends 75% of its time planted, and 25% of its time moving. That's partially why reptiles wiggle side to side as they walk. They lean into the tripod while moving one limb.
(Hopping is an alternative mode but it's only useful for a certain class of motion. Frogs for example, hop for distance and speed but wiggle like a reptile when moving slowly. Hopping insects use the meshed tripod when moving slowly.)
But the more brain power you apply to the problem the more dynamic you make the whole system and the less time you have to rely on static gravity and fixed footing to provide stability. Mammals (and birds) evolved from reptiles so they start with four limbs but with more brain power, they need only one limb planted for a static load. The other three limbs can be doing other things. Animals like horses use the time in the air to get very long strides, very quickly. Animals like cheetahs use their air time for both for long, high speed strides and lateral control. In either case, at speed, only one limb is touching the ground at any one time and often, no limbs are touching at all.
If you only need one limb touching at a time and you don't actually run fast, say you live in a tree or a cluttered ground environment, then you really only need two limbs for basic support and motion. One leg supports while the other provides control. The other two can be tasked to other things like manipulating the environment.
Look at raccoons, they walk on all fours but spend a lot of time sitting or squatting while using their forelimbs for manipulation. They don't have opposable thumbs but instead, their palms fold over top to bottom and side to side to make a surprisingly efficient grasping surface, especially for grabbing wet slick things.
(Human hands evolved to grasp cylinder shaped branches. Species that don't evolve their manipulating limbs in trees will have different manipulating criteria.)
Once you spend a lot of time sitting and manipulating, and your brain grows to give more control, you eventually reach a point where it pays more to dedicate the bottom limbs to motion and the top to manipulation. Balancing the body atop the bottom two legs gives the manipulators more room to work and the sensors clustered in the head a greater range and sweep.
At this point you have a basic "humanoid" with legs at the bottom, a torso (formerly parallel to the ground - now perpendicular), manipulating limbs on the upper body above the legs and a head on top. As it grows more intelligent, the head gets bigger to contain more neurons.
That would look like a human from a distance.
This basic form was made highly likely nearly a billion years ago back with the dominance of the linear body plan.
But one can see many different avenues to get there. Humans evolved from tree-dwelling proconsul and then moved to the ground. We evolved then primarily for tool use and long distance running.
But a species might start out bipedal and fast, like a kangaroo, optimized for fast running and then slowing down as it evolved manipulation. A wallaby is a slow kangaroo that occupies a niche much like that of raccoons. It squats and manipulate and hops only slowly.
Ancient sloths were apparently almost entirely bipedal and used their forelimbs to pull down foliage to eat, if they had to manipulate the trees to a higher degree they might develop "hands" of some kind.
But it's far form determinate. Even minor changes in environment, say, higher gravity, could change things. On a higher gravity world, animals might need more limbs even if they had big brains. A tool-using species there might look more like a very squat centaur.
Chance could play a role. While selection is not random, it can only work with the variations that occur at any given time. While physics prefers certain forms, if variation does not provide the raw material for the optimal form at the optimal moment, then selection will take what variations it has and use those to compress a species into the best shape for the circumstances.
If, early on, a radial genus got a significant edge in an ability/function other than linear motion e.g. sight, oxygen breathing, bones, faster neurons, etc., then it could out-compete linear body plans even if they had the edge in motion.
Once radials occupied a vast number of niches, they would block the evolution of the linear organisms into those niches. At that point, selection would find it easier to modify a radial body plan to be more linear than to parallel evolve all the radial specific systems all over again in the linear branch.
(It very much like the problem of creating entirely new computer platforms and operating systems from scratch. The dream is to get rid of all cruft and barnacles that the systems accumulate but in the time it takes to create a new clean system, the old system has evolved further. The new systems never quite catch up. Sigh.)
For example, consider a species that starts out like a radial star fish but begins to swim. A quick optimization for streamlining would be to fold the radial limbs all back into a tear drop shape with the sensory cluster, formerly at the top and center of the radial form, not at the front. It would now look superficially like a fish.
With streamlining being so important to fast moving aquatic forms, the radial limbs could simply fuse externally to making what looks like a unitary fish-shaped body from the outside but the basic radial template would always be there. Turn off just a couple of genes and the fish shape might pop out to a radial shape. It would be like fish that had a tendency to to give birth to octopi. (But, an octopus with an internal skeleton with tentacles more like snake bodies i.e. flexible but rigid and load bearing.)
On land or shallow fresh water, a radial genetic base might be an advantage. It might shape some of its radial modules to a fish shape but leave a few free flexible like tentacles for anchoring. When it found itself beached, the tentacles could move it around. Eventually, it would breath air and move to land. How it would "walk" would vary, but from very early on in its evolutionary history, it would have manipulating limbs, perhaps a lot of them.
(It's easy to make another radial limb just by altering a single gene. The species will have a master gene, a hox gene, that basically says, "take the basic starfish "limb" starting point and repeat it "X" units. Altering that single gene would produce an arbitrary number of limb units which could then each be customized to function as needed.)
Perhaps virtually all animals on land or sea would have a limb or two capable of manipulation. In that case, "technology" might evolve from genetic behaviors long before brains got big enough to generate the behaviors from "software." A real world example of a genetic technology is a termite mound, a very sophisticated structure we would instantly recognize as technology if termites were the size of dogs and their mounds the size of skyscrapers. Another example would be beaver dams, ponds and canals.
(We just have a bias for "tools" things held in our hands, but shaping the external environment to a specific form for a specific function is clearly technology. Burrows, nests, and other structures qualify.)
That would be a very interesting world even before sentience evolved. And not a humanoid to be seen.
But such a world is statistically less likely than a humanoid one because it requires a less efficient movement form, the radial body plan, to get a significant, non-movement advantage at just the right time while at the same time, the linear body plan competitors don't.
In summation, when we go out and actually discover a large number of Earth-like worlds sentient, we would find the majority of worlds have the physics-preferred forms of fish-shaped swimming organisms, bird/bat-shaped flying creatures, four limbed, big brained land animals and bipedal, largely vertical standing, two-armed, big-headed, "humanoid" tool-using sentients.
The worlds that didn't would be less common but much more interesting.