talking about if you have the EXP share on vs off
If the EXP Share is on, the Pokemon in your party will gain all the normal EVs as if they were in battle. If the EXP Share is off, only the Pokemon who were in battle will gain any EVs.
Source: Experience