I'm confused about when to use "en/y" and "lui/leur"
For example:
Je téléphone à mes amis.
becomes:
Je leur téléphone.
But you also have:
Il va à Paris.
That becomes:
Il y va.
What's the difference between these "à"?
I'm confused about when to use "en/y" and "lui/leur"
For example:
Je téléphone à mes amis.
becomes:
Je leur téléphone.
But you also have:
Il va à Paris.
That becomes:
Il y va.
What's the difference between these "à"?
À is a preposition used to indicate destination. It is very often used after a verb indicating movement to introduce the destination.
There is no difference in the use of à in your two sentences.
Je téléphone à mes amis.
À introduces the person you are talking to over the phone. (Beware that in French téléphoner introduces an indirect object*, so we have téléphoner à just like we have parler à.
Il va à Paris.
À introduces the place you are going to.
In both cases when you replace the complement "à mes amis" / "à Paris" by a pronoun (leur used for an indirect object, y for a place) the pronoun goes before the verb and à disappears, indirect objects pronouns leur and y contain the idea of destination conveyed by à.
Je leur téléphone.
Il y va.
*Unlike English where we phone somebody (direct object).
First, let's distinguish two types of complements that can be marked with à: the first are locative adjuncts, for example "à Lille" in "j'ai rencontré les parents de Sabri à Lille". They're not an obligatory complement, they could be replaced by any locative phrase headed by another preposition (dans le centre commercial, en forêt, chez eux, sur la plage, etc.), and they can qualify any verb. Those locative adjuncts are always pronominalised by y or by an adverb like là.
The second are indirect objects that are an intrinsic part of a verb's valence. For example donner (give) has two intrinsic complements: donner [quelque chose] [à quelqu'un] and those complements deeply affect the meaning of the verb ("sauter sur quelqu'un" et "sauter quelqu'un" mean something extremely different from each other). Those behave in a much more interesting manner with regard to the pronominalisation of their à-complements.
I'd categorize them in tree groups. One of them isn't sensitive to the animacy of their complement, the other two are:
Verbs that always take lui and leur
For example, manquer à (to lack, to be missing) or donner un coup de pied à (to kick)
Il manquait un doigt à ce marchand - Il lui manquait un doigt (This street seller/he was missing a finger)
Il manque une porte à cette maison - Il lui manque une porte (This house/it is missing a door)
J'ai donné un bon coup de pied à mon frère - Je lui ai donné un bon coup de pied (I kicked my brother/him good)
J'ai donné un bon coup de pied à la porte - Je lui ai donné un bon coup de pied (I kicked the door/it good)
Note however that a verb of this type can also be accompanied by a locative adjunct, that may be pronominalised with y:
This is rarely done in speech however, we'd rather use là (Je leur ai téléphoné là).
Verbs that (underlyingly) always take y
Those include s'interesser à (take an interest in), faire attention à (pay attention, be careful about) or penser à (thinking about). When the à-object is inanimate, their pronoun is y. When it's animate, we use "à + a strong pronoun"
Je me suis intéressée à la peinture - Je m'y suis intéressée (I took an interest in painting/it)
Je me suis intéressée aux peintres du XVIIIème - Je me suis intéressée à eux (I took an interest in 17th century painters/them)
However, the pattern is a bit different when we use a doubling construction:
La peinture, je m'y suis déjà intéressée
Les peintres du XVIIIème, je m'y suis déjà intéressée
The proscription against using y to refer to an animate disappears.
Verbs that take lui/leur when the referent is animate and y when it's inanimate
Those are relatively marginal in number. Two clear cut examples are ressembler à (look like) and répondre à (answer):
Ce tableau ressemble à Marco - Ce tableau lui ressemble (This painting looks like Marco/him)
Ce tableau ressemble à un champ de bataille - Ce tableau y ressemble (This painting looks like a battlefield/it)
Il répond à l'élève - Il lui répond (He answers the student/him)
Il répond à la question - Il y répond (He answers the question/it)
For both of those categories, the strong pronoun à ça can be used instead of y.
How to know whether a verb belongs to which class? Unless you know Latin (lui/leur verbs tend to descend from verbs that took dative complements, y verbs from those that took prepositional phrases with ac/ab/ad), you'll have to memorize it as part of your knowledge of the verb.
You use leur when you are referring to them, where them is some people or some animals. You use y when you are referring to it an inanimate object. For example I respond to them where the them is some people is je leur réponds but if the them is some questions then the French is je y réponds. There's more information on this grammar point at https://rapidefrench.com/grammar/13/
"Y" is used when it concerns a place
Il va à Paris : il y va.
Tu es à Londres : Tu y es / T'y es
Je suis chez moi : J'y suis.
And, the first sentence you wrote is false : it becomes Je leur téléphone.