It’s more useful to rephrase this question as: “When are you supposed to use implicit subject as opposed to explicit?”
As you probably know, because of the way verbs are conjugated in Spanish, many times you can omit the subject performing an action because the conjugated verb already contains all necessary information to keep track of who is doing what. If you want a refresher, you can check out this blog post.
There is no hard-and-fast rule that dictates when you should and shouldn’t use an implicit subject. Instead, you have to keep in mind three things: clarity, emphasis, and possible points of ambiguity.
Generally speaking, you want to communicate with as much clarity as possible, in order to communicate your ideas effectively, without using unnecessary words. For example, if you are chatting with a friend about what John did, you can include John’s name in the first phrase, but from then on you would continue the conversation using implied subject, until you start talking about someone else.
“John dijo que no le gustaron los tacos. Comió solamente tres, cuando otras veces come ocho o nueve. En cambio, le encantó la cerveza.”
If we changed that phrase to use only explicit subject, it would read:
“John dijo que no le gustaron los tacos. Él comió solamente tres, cuando otras veces él come ocho o nueve. En cambio, a John le encantó la cerveza.”
As you can see, it becomes both cumbersome and useless to try and state the subject each and every single time, when it is perfectly understandable who you are talking about, until you specifically state otherwise. As you can see in the example, this applies even when using just pronouns.
Emphasis can be expressed by using an explicit subject when it isn’t actually required for clarity. It is usually accompanied by a stress in pronunciation.
For example, imagine you’re with your friends at a BBQ, and the chef offers you and John a plate of grilled vegetables. You could say:
“John es estrictamente vegetariano. Él puede quedarse sin comer hamburgesa, pero yo no.”
The possibility for ambiguities may also play a role in deciding whether or not you want to use an implicit subject. You may or may not want the meaning to be ambiguous (after all, many jokes are based on ambiguity), and keep in mind that some ambiguities may be resolved by punctuation or verbal intonation.
To give you a concrete example, the word “como” could be interpreted as a verb (i.e. “comer”, conjugated in present tense for the first person singular, “yo como carne”), as an adverb of comparison (e.g. “dulce como la miel”), and verbally it could also be interpreted as an interrogative (“¿cómo es eso?”) or an intensifier (“¡Cómo me gustan las fresas!”). Therefore, a phrase like “como atún” could be interpreted as ‘I eat tuna’ or ‘like/as tuna’. If you mean to say the former, you could avoid ambiguity by adding an explicit subject: “Yo como atún”.
There you go, using these three guidelines you can decide whether or not using an implicit subject would be appropriate for a given situation.