Couple things. Your code is only checking to see if one number is prime. You need another loop to check every number less than num
The alg for prime is not quite right. You don’t want to push to prime unless the only factors are 1 and itself. So any mod result of zero for 2 to num-1 means not prime.
Your code pushes 2 5 and 10 but should push 2 3 5 7. In the other test pushes 977 which is prime but you have to check every number 2 to 977. There are a bunch.
You have made a really good start on the challenge. Hope this helps.