The cell notation places magnesium oxidation on the left: Mg(s)→Mg2+(aq)+2e−. At the right electrode, 2Ag+(aq)+2e−→2Ag(s). The net reaction is Mg(s)+2Ag+(aq)→Mg2+(aq)+2Ag(s).
Two electrons are transferred per reaction, and pure-solid activities are unity. The reaction quotient is Q=a(Ag+)2a(Mg2+), approximated in the usual dilute-solution notation by [Ag+]2[Mg2+].
The Nernst equation is
Ecell=Ecell∘−(2FRT)lnQ=Ecell∘+(2FRT)ln([Mg2+][Ag+]2).
This is option (2). The exponent 2 is required by the silver-ion stoichiometric coefficient.