The half-life is the amount of time it takes for half of a given amount to disappear, or decay. After one half-life, there's half as much; two half-lives, a fourth as much; three half-lives, an eighth as much; etc.
In other words, if $A_0$ is the original amount of substance, then the amount of substance left after $n$ half-lives is $$A=\frac{A_0}{2^n}.$$
In this situation, then, you want $$\frac{500}{2^n}< 100,$$ or equivalently, $$5<2^n.$$ If we're dealing with integer numbers of half-lives, then $n=3$ half-lives must pass, so $15$ units of time must pass (you didn't specify what units of time your half-life was in). If we aren't requiring integer numbers of half-lives, then we'll hit both sides with a logarithm to get $$\ln 5 so $$n>\frac{\ln 5}{\ln 2},$$ so more than $\frac{5\ln 5}{\ln 2}$ units of time must pass.
Edit in response to OP's edit
I would note that there is a difference between "less than $100$" and "less than or equal to $99$", but if you're only concerned with integer amounts, then you've set it up perfectly. If we divide by $99$ and multiply both sides by $2^{t/5}$, we get the equivalent equation $$2^{t/5}=\frac{500}{99},$$ and hitting both sides with a logarithm gets us $$\frac{t}5\ln 2=\ln\left(\frac{500}{99}\right),$$ whence $$t=\cfrac{5\ln\left(\frac{500}{99}\right)}{\ln 2}.$$