I cobbed this from another post. I do not own a timer nor am I an electrician. This is for information only and I willl assume NO responsibility.

A little more info about your particular timer would be helpful.

Good luck!

The timers black (hot) goes to the phase (hot) of the mains.
The timers red (load) goes to the black (hot) of the switch/fan (as that is the load).
The white is connected to the other white plus to the white from the mains.
The green is connected to the other green plus to the green from the mains.

The timer need to be connected to hot and neutral (what you call common) to work and to ground to be "safe".
To supply the fan, it further needs an output, which is hot when the timer is supposed to drive the load connected to it and hence the four wires.