Caffeinated drinks may send you to the loo quite often, but liquid in the coffee or tea still counts toward your hydration goal, because it is mostly water.
Caffeinated beverages do not dehydrate you when consumed in
moderation of about five cups or less per day. In fact, any fluids
you ingest will help keep your cells saturated, including coffee,
juice, tea, or soda.