Are you sure it's not g'(x)-g(x)-2e^x=0 ?
Partially differentiating the equation with respect to x and y separately, we get
g'(x+y)=g'(x)e^y+g(y)e^x
and, g'(x+y)=g(x)e^y+g'(y)e^x
so, g'(x)e^y+g(y)e^x=g(x)e^y+g'(y)e^x
or, [g'(x)-g(x)]e^y=[g'(y)-g(y)]e^x
suppose, for some x, g'(x)=g(x).
Then, for all y, 0=[g'(y)-g(y)]e^x.
Since, e^x is always positive, g'(y)-g(y)=0,
implying g(y)=e^(y+c) for all y, and some
constant c.
From g'(0)=2, we get g(y)=2e^y for all y.
From the equation, 2e^(x+y)=4e^(x+y) for all
x,y. Or, 2e^(x+y)=0, which is impossible.
Therefore, g'(x)-g(x) is non-zero for all x.
or, [g'(y)-g(y)]/[g'(x)-g(x)]=e^y/e^x, for all x,y.
So, g'(x)-g(x)=ke^x for all x, where k is a constant.
Solving, and imposing the 2 conditions ( g'(0)=2, and g(x+y)=g(x)e^y+g(y)e^x), we get
g(x)=2xe^x, implying, g'(x)-g(x)-2e^x=0.