A sandwich needs 2 slices of bread and 1 slice of cheese. With 20 slices of bread and 15 of cheese, the bread is enough for 10 sandwiches and the cheese for 15, so you make 10 and keep 5 slices of cheese. The bread runs out first even though you had more bread than cheese, because each sandwich takes twice as much of it. A reaction works the same way, with moles in place of slices and the balanced equation as the sandwich recipe.
The reliable test is to divide each reactant's moles by its coefficient, which tells you how many "batches" of the reaction that reactant could supply. For N2+3H2→2NH3 with 3.0 mol of N2 and 6.0 mol of H2, nitrogen supports 3.0/1=3.0 batches and hydrogen 6.0/3=2.0. Hydrogen gives fewer, so it is limiting, though there is twice as much of it. The product follows from hydrogen: 2.0 batches make 4.0 mol of NH3.
Not every two-reactant problem needs this comparison. If the problem says one reactant is "in excess", or a metal burns "in air", the other reactant is limiting by design, and plain stoichiometry from it is enough. And if both amounts are exactly in the equation's ratio, such as 2.0 mol of H2 with 1.0 mol of O2, neither is limiting: both run out together and nothing is left over.
Think of it like this. Hot dogs come 10 to a pack and buns 8 to a pack, so one pack of each makes only 8 complete hot dogs, and 2 sausages are left without buns. The buns are limiting. A reaction runs out in the same way, except that you compare moles divided by coefficients, not raw grams.
Core idea. A reaction stops as soon as any one reactant is used up, so the maximum product is set by the reactant that supplies the fewest batches of the balanced equation (its moles divided by its coefficient), not by the reactant with the smallest mass.