Hi Christos;
Knowing what the function is equal to is part of the problem. It is actually equal to 5 but you don't know that until you complete the squares. Once you know the function equals 5, you can plug the function into Solve[] and get the answer.
Thanks,
Mitch Sandlin
Check the three alternatives in the file. There are many solutions if z (the right part side) is positive (or Integer).
You can complete the squares with a replacement rule, like this:
2 x + 4 y - x^2 - y^2 //. a_*u_ - u_^2 :> -(u - a/2)^2 + a^2/4