Firstly, you should understand how this works.
What can x and y be? There are infinitely many answers in the rational set.
So, what can x and y be if x and y are natural numbers?
The answer is not hard to see, 7 has two factorizations, 7.1 and 1.7. So (x,y) = (7,1) or (x,y) = (1,7) will be correct.
Even when we assume that x and y are natural numbers, you have to think of every factorization of the RHS. When the RHS was 7 it wasn't a problem, there were only two possible factorizations.
But what happens if the question was ?
There are lots of factorizations,
(x,y) = (1,120), (2,60), (3,40), (4,30), (5,24), (6,20), (8,15), (10,12), (12,10), (15,8), (20,6), (24,5), (30,4), (60,2), (120,1)
So if you have an equation where the factors are natural numbers, you have to try every single possible factorization in order to get the correct answer.
If the factors x and y are not natural numbers, we can't use this approach.