For both, apply inclusion-exclusion
For 1) count the number of ways where box 3 or 4 was empty and subtract this away from the total.
There are $4^5$ ways total where we don't care about empty boxes. There are $3^5$ ways where box $3$ was empty. There are $3^5$ ways where box $4$ was empty. There are $2^5$ ways where both boxes were empty.
$$4^5-3^5-3^5+2^5 = 570$$
For 2) similarly approach, and organize the results a bit better to make it cleaner to write:
$$4^5-4\cdot 3^5+6\cdot 2^5 - 4\cdot 1^5 + 1\cdot 0 = 240$$
Alternatively, without inclusion-exclusion, recognize that for each box to get at least one object, with these numbers that directly implies that one of the boxes gets two and each remaining box gets one object.
Choose which two objects were place in which box together, then for each remaining box choose what object was placed in it.
$$\binom{5}{2}\cdot 4! = 240$$