If in exam one gets confused then use some common sense like this-
(e,n) Public key
d is private key or (d,n) is private key
Now encryption should be allowed to anyone, Therefore to encrypt protocol must use public key only.
Hence, $M' = M^e \text{ mod n}$
d is private key and this should not be calculated using public componentent i.e. $\text{(e, n)}$
Hence, $d⋅e ≡ 1 \text{(mod φ(n))}$