The way to approach this type of problem is to pick one of the reactants at random and determine how many grams of the other one are needed to react with it completely. Then ask the question." Do I have that much?" If the answer is yes, there's more than enough, then the reactant you picked at the beginning is the limiting reagent. If the answer is no, then the second reactant is obviously limiting. You then use the limiting reagent to not only figure out how much product is made, but also to figure out how much of the other one is consumed (if you didn't happen to find that out in the first step)
The best way to do these calculations is with "the box", treating molar masses as a "conversion factor" and getting the mole ratio from the balanced chemical equation.
For instance, select Mg, and find out how much CO2 is needed to react with it. From the equation, the 1 mol CO2 reacts with 2 mol of Mg
71.66 g Mg | mol Mg | 1 mol CO2 | 44.01 g CO2 = 64.865 g CO2 Do you have that much? YES
| 24.31 g Mg | 2 mol Mg | mol CO2 Therefore Mg is the limiting reagent
Note that all the units cancel, giving you the correct units at the end. You can literally let the units lead you through the calculation.
The theoretical yield of MgO will be based on the limiting reagent , Mg
71.66 g Mg | mol Mg | 1 mol MgO | 40.31 g MgO = 118.8 g MgO
| 24.31 g Mg | 1 mol Mg | mol MgO
The percent yield is Actual yield x 100% = 23.75 g X 100% = 19.99%
Theor. yield 118.8 g
The amount of CO2 in excess can be found by subtracting the amount of CO2 consumed in the reaction (we found this in the first step) from the original amount.
Excess CO2 = 91.25 g - 64.86 g = 26.39 g CO2
Note that if we had not picked the limiting reagent Mg in the first step and had instead calculated the amount of Mg needed for the given amount of CO2, we would have to do our original calculation here to determine how much CO2 was consumed. The limiting reagent can be determined by picking either one at the beginning.