Hi Sukham,
I'll go through both examples you've given me and try to clarify this way.
1. Mg(NO3)2
The subscript only means you have 2 NO3 ions in this molecule, for a total of N2O6 in terms of atom count.
You'd then go through a different process to look at charge.
Since your overall charge of the molecule is 0 here, your charges of Mg and NO3 must add up to 0.
Mg is an alkali earth metal which usually ionizes to form Mg2+.
From here, we can us 0 = 2 + 2x, where x is the charge of one NO3, to solve for the charge of one NO3.
Solving the previous equation yields x = -1.
This makes sense because NO3 is a common polyatomic ion, and is listed as having a charge of -1.
2. [Cu(NH3)4]2+
For this molecule, we have 4 NH3 molecules, or a total of N4H12 atoms if you're looking for empirical formula.
However, for the charge we must follow the same process as before.
NH3 here if you look at the Lewis structure, has a charge of 0.
The overall charge of the molecule is 2+.
As a result, the charge of the Cu is 2+ = x + 4(0) where x is the charge of the copper.
In the end, the charge of Cu is 2+.
Things like this can get tricky for coordinate covalent complexes because you can have neutral ligands like NH3 or H2O.
Please let me know if this is unclear!
Katt