The theoretical yield is the most product the limiting reagent allows and the percentage yield is the actual mass over it: 28 g of nitrogen and 8 g of hydrogen can make 34.0 g of ammonia, so getting 27.2 g is an 80 percent yield.
Find the limiting reagent, take its moles through the coefficients to the moles of product and convert to grams (34.0 g here), then divide what you actually weighed by that and multiply by 100. The shortfall is side reactions, an incomplete reaction and losses in separating and drying the product.
A yield over 100 percent is not good luck: it means the product is wet, contaminated, or the arithmetic is wrong. And a high yield is not a green reaction; for that look at the atom economy and the waste, which the yield does not see.
Estimate with the rule, then check it against the calculator that models it properly.
Open Reacting Masses & Yield →