1. The derived work is transformative. It uses the original as inspiration but the end result is substantially different.
2. Only a trivial amount of the work is copied (a few lines of code out of thousands/millions).
3. It is hard to prove that the creators of the original work were damaged by copilot (for example did they lose any customers or revenue?) This is normally the single biggest test in such cases.