Is it:
Nobody was ever there for me when I needed him.
or
Nobody was ever there for me when I needed them.
Since "nobody" contains no information about the persons' genders the word to use is "them". "They/them" can also be used to refer to someone in the third person singular form:
They were never there for me when I needed them
Without context this sentence could refer to either one or multiple people.