generate 2 line from 1 lines

Hello,

how can I achieve this transformation please,

if A=0 or B=O => keep same line,

if A# 0 and B # 0 => generate a 2nd line with a 0 as on the screen.

thank you for your answers