You count is most likely not reaching the needed value of 4 because count only increments if the value stored in the lottery array are the same as that stored in the user array. While possible it is unlikely that random integers selected 1 - 9 would be chosen exactly matching that of what the user gave.
Either keep asking for numbers until the arrays match or more probable have an else statement on the last if to say they did not win the lottery.