Just wondering how the components for eyeX, eyeY, eyeZ are derived
I'll give you an idea on how I would approach this assignment and answer your question at the same time.
For rotation, you say that your rotation method is working, instead of using the traditional glrotate, so i'll leave the rotation alone.
For translation, the first 3 components of gluLookAt are the position of your eye in world space, which you seem to have calculated correctly, assuming your rotation are correct.
The next 3 components are where your eye will be looking. So, in your scenario of an earth orbiting around a sun, assuming your sun in centered at the origin, these 3 components would be (0,0,0), which would have your eye looking towards the origin(at the sun).
gluLookAt(eyeZ * cos(theta) * sin(phi), eyeZ * sin(theta), eyeZ * cos(theta) * cos(phi), 0, 0, 0, 0, 1, 0);
gluLookAt(eyeX * cos(theta) * sin(phi), eyeY * sin(theta), eyeZ * cos(theta) * cos(phi), 0, 0, 0, 0, 1, 0);