Hopefully this helps. The exact placement of the valves, piping and fittings is up to you but this is what you are trying to achieve. During normal operation the valve on the bypass line is closed and the cold and hot water valves are open. In bypass mode the hot and cold valves should be closed and the bypass valve open.
__________________
|