For the denominator, you're right on the mark.
The graph crosses the $x$-axis at $-2016, 1001$ and $2019$. That means the numerator must be some multiple of $(x+2016)(x-1001)(x-2019)$. The leading coefficient is equal to the horizontal asymptote. We have to guess its height, but considering the $20\,000$ tick marks on the $y$-axis, and just wildly guessing, I'd make an initial guess of about $1500$. However, I think there is a better way.
We evaluate what we have so far (with leading coefficient $1$) at $x = 0$ and get
$$
\frac{2016\cdot (-1001)\cdot (-2019)}{500\cdot (-500)\cdot (-1500)} \approx 10.86
$$
From the graph, we can see that it crosses the $y$-axis just about halfway up to $20\,000$. Meaning we want the above result to be almost exactly $1000$ times larger.
Thus we land on
$$
f(x) = \frac{1000(x+2016)(x-1001)(x-2019)}{(x+500)(x-500)(x-1500)}
$$
How do I know how many times the graph crosses the horizontal asymptote?
From the graph, it seems obvious to me that the answer to that is $1$. But you ought to double check that the local minimum between $-500$ and $500$ is high enough, just to be sure. It crosses exactly once between $500$ and $1500$ (maybe one should double check that it's actually strictly increasing here, just to be sure), and to the left of $-500$ and to the right of $1500$ it can't cross the asymptote as it's monotonic.