What are the products in a reaction between a metal and an acid? When magnesium metal and hydrochloric acid react, hydrogen gas is released (and not chlorine gas). However, when metals such as copper is placed in nitric acid, NO(g) is released and not hydrogen. So, how do we know that chlorine gas is not released in the first reaction? Does this have to do with reduction potential?
Nitric acid ($\ce{HNO3}$) is a strong oxidizing agent. The hydrogen gas ($\ce{H2}$) produced in the reaction with metal is oxidized to $\ce{H2O}$, in turn evolving nitric oxides like $\ce{NO2}$ and $\ce{NO}$. Even magnesium can be observed evolving nitric oxides when reacted with $\ce{HNO3}$.

Additionally, you know that chlorine gas isn't released by the reaction of $\ce{HCl}$ with magnesium because you would see it evolved from the solution as a pale, yellow-green gas. Instead, only clear hydrogen gas is evolved.