If X is an employee, Y owns the copyright. If X is a contractor, X owns the copyright
Without a written contract, only employees can make work-for-hire in the United States and most other common law jurisdictions. As described the relationship is sufficiently ambiguous that an argument about whether X was an employee or a contractor would definitely be an issue in any suit about the copyright.
On the information given, it’s sufficiently ambiguous that I have no idea how that would go - “build an app” suggests contractor, “$ per week” suggests employee. Ultimately this will be decided by the court considering the totality of the relationship.
Employee
This is the simplest.
Y owns the copyright. X is owed their wages and other entitlements.
There is no such thing as a “mandatory counterclaim”, X would be wise to raise a counterclaim and would probably win on that if they did; but they don’t have to.
If X is an employee, they are entitled to their pay even if they produce nothing. In fact, they’re entitled to their pay even if they create negative value for Y. It’s Y’s responsibility to manage and control the work of Y’s employees.
Contractor
There is no written agreement so this is not work-for-hire. X owns the copyright but there is probably an implicit licence for Y to have used the app had it been completed.
The terms of such a licence might be an issue in the case; typically, the court will imply the minimalist licence that will allow Y the benefit of the contract. That would generally mean a non-exclusive licence so X’s use would not be a breach.
X might argue that there was a complete failure of consideration by Y (i.e. X received literally no benefit from the contract) and this gave them the right to terminate the contract. Whether they had such a right and had executed it correctly depends on facts not stated.
Of course, Y could claim that the product supplied did not meet the implied terms of merchantability or fitness for service and they no money was owing until it did. If so, X had no right to terminate and instead repudiated the contract entitling Y to damages (say the cost of having someone else write the app less how much they would have paid X plus any losses arising from the delay).
Y does not have a valid claim for copyright breach because X owns the copyright.
In both cases, there are plenty of scenarios that would make a contract void but none of them are obvious from the stated facts.