When the input 1 and input 2 =5v ,then both the diodes are off the transistor get enough base drive from the supply through resistor and therefore transistor is ON and output = V ce(sat) corresponds to 0v or V=0v at the time the transistor is OFF and therefore out voltage= 5v