To put a hole at x = - 1 , put the linear factor (x + 1) in the numerator and in the denominator.
To put vertical asymptote at x = - 2 , put (x + 2) in the denominator only.
To give it a horizontal asymptote of y = 3, we need the degree in the numerator and denominator to be = and we need the ratio of the lead coefficients to = 1.
Lastly, returning to the hole, to make sure the y-value of the hole is at + 1, we need to have the rest of the function, ignoring the (x + 1)'s, = 1 when x = -1. Putting all of this together, we get ...
y = (3(x+1)(x+k))/((x+1)(x+2)) and the last requirement forces k = + 4/3 so
y = (3(x+1)(x+4/3))/((x+1)(x+2)) or, distributing the 3 in the numerator to the 2nd linear factor pretties it up to ...
y = ((x+1)(3x+4))/((x+1)(x+2)) or FOILed out, y = (3x2+7x+4)/(x2+3x+2)