Does carbon monoxide form or carbon dioxide forms when carbon reduces metal oxide?
If both carbon monoxide and carbon dioxide are thermodynamically favored, then carbon monoxide comes "first" in the sense that the metal oxide first oxidizes carbon to $\ce{CO}$.  This is because the reaction is carried out at relatively high temperature where any potential carbon dioxide would itself react with carbon to form the monoxide.  If more oxide is available after all the carbon is converted to $\ce{CO}$ and further oxidation to $\ce{CO2}$ is favorable, the latter reaction then occurs.