The pronoun y is used for replacing a place with prepositions that use à or en. Eg. Je vais en Italie -> J'y vais. Furthermore it can be used to replace verbs that use the preposition à. Eg. Il pense à son avenir -> Il y pense. ATTENTION! This is only applicable for objects, thus if it were Il pense à sa mère, it would not be replacable and would become il pense à elle. On the otherhand, to use the pronoun en, this is used to replace a quantity. Eg. Elle veut cinq crayons -> Elle en veut cinq. Similarly to y, en can be used to replace an object, but only if the preposition 'de' is used. Eg. Elle parle de son travail -> Elle en parle. This cannot be used to replace a person, like y.