For your application of routing flow from one to two different directions requires a 3-way valve, so called because it has three connections, one for inlet and two for outlets. I would assume you would continue to use the existing manual valve to control the actual flow rate as you shower, with the new 3-way value installed upstream to just direct flow to storage or shower valve, and as such would probably be cheaper (relatively, still not cheap due to port size) to use a 3-way solenoid valve and therefore control would be much simpler and cheaper power mosfet switching transistor controlled by the arduino.
The more expensive route would be a quarter turn 3-way ball valve mechanically coupled to a high torque servo but I'm sure that would be much more expensive then the 3-way solenoid valve. If using a solenoid valve be sure to use a 12 or 24 vdc coil rather then mains powered as water and mains power can be a dangerous combination and probably not legal for DIY installations.
The more professional solution is to install a whole house instant hot water function where there is small continuous flow from the hot water heater to all the service locations with a return loop back to the water heater But that is not a simple DIY project and needs lots of pipe insulation and other details to keep the energy costs under control.