Is eight glasses a day actually right?
It's a rough, generous rule of thumb rather than a target. Needs vary with body size, heat, and activity, and food supplies a decent share of your fluid. Colour is a better guide than any number.
Does tea or coffee count?
Mostly, yes. The diuretic effect of a normal cup is mild and it doesn't cancel out the fluid you drank. Coffee still counts toward hydration — it just shouldn't be your only source, and it comes with its own reasons to have a cutoff.
Why does this sit under sleep and energy?
Because the two most common symptoms of being mildly under-hydrated are an afternoon slump and a dull headache — the exact things people blame on bad sleep and then treat with more coffee.
Can you drink too much water?
Yes, though it's rare and mostly happens with very large volumes in a short window. If your urine is completely clear all day, you're past useful and can ease off.