"When you needed was there" is bad grammar. It has to include the word "me" or "he" or "she" or "us" or "them" as in "When you needed me, I was there" or "When you needed her, she was there" or "When you needed him, he was there", or "When you needed us, we were there" or "When you needed them, they were there" in order to make sense.