This is just the application of de Morgan's laws:
\neg(A\land B) &\equiv (\neg A)\lor (\neg B)\\
\neg(A\lor B) &\equiv (\neg A)\land (\neg B)\,.
These are fairly obvious, if you think about them for a moment: if something isn't both $A$ and $B$, then it must fail to be one or the other (or both); if something is neither $A$ nor $B$, then it is not $A$ and it is not $B$.
In your case, $A$ is "it is a NTM" and $B$ is "it has an accepting run on $w$ of length at most $|w|$." Using the first version of the law, the complement is "it is not an NTM or it does not have an accepting run on $w$ of length at most $|w|$."
That alone may be enough to answer the question, but you might also want to push the negation in the second half ("it does not have an accepting run on $w$ of length at most $|w|$"). In this case, we need the rules for negating quantifiers:
\neg\forall x\,C(x) &\equiv \exists x\,\neg C(x)\\
\neg\exists x\,C(x) &\equiv \forall x\,\neg C(x)\,.
Again, take a moment to convince yourself that these are true: if it's not true that everything is $C$, it must be that something is not $C$; if there doesn't exist something that is $C$, then everything must be not $C$.
In your case, writing $B$ more formally gives "There exists a run $r$ on $w$ such that $r$ accepts and $r$ has length at most $|w|$", so $C$ is the property "is accepting and has length at most $|w|$." Negating $B$ gives "Every run $r$ on $w$ is not both accepting and of length at most $|w|$" and applying de Morgan again gives "Every run on $w$ is rejecting or has length more than $|w|$ (or both)."