I translated 'Er' as 'it' thus "It is my life" which makes more sense to me than the answer given, but it was given as incorrect. So my question is which part of the sentence makes Er = "he" and not "it"?
I'd say, when in doubt, use the most direct translation, which is "er" → "he". Of course this is dependent on context, you could be talking about anything with a masculine article in German, a dog, or a tree or whatever, but in this case the question would also be, if the object isn't personified and therefore 'deserves' the "he". The other way around for example, if I said "es ist mein Leben", it is much more likely, almost certain, that I'm talking about a concept, than a person or any other object.
Since the Duolingo sentence has no context, I think it could go either way, but it depends on what 'er' is referring to. Let's say I really like a certain tree, I could say, "Ich liebe den Baum. Er ist mein Leben." If you think the context is more like, "I can do whatever I want! It's my life!" then "er" doesn't make sense, because it's sort of self-referential (my life is my life!) because Leben is neutral.
I mean, in this case, the sentence is in the "Spiritual" section, so I presumed the subject to be some animate being.
Er can be used as it, the same way that sie can. Es is used when the noun it's repacing is neuter or the gender unknown. Er can be used for masculine nouns and sie for feminine.
Ok but If you were to hover your mouse over the word 'Er', it gives you the options of 'He' or 'It'. So if 'Er' is always translated as 'he' why is there the alternative option
It's because inanimate objects can still be grammatically gendered in German (e.g. der Baum), but in English we would just refer to them by the pronoun "it."