In how many ways can five employees be assigned to four projects if each employee is assigned to one project and each project is assigned to at least one employee?
There are four choices of assignment for each of the five employees, so there are $4^5$ possible ways to assign projects to employees. From these, we must exclude those assignments in which not all the projects are assigned to an employee.
There are $\binom{4}{1}$ ways to exclude one of the projects and $3^5$ ways to assign the remaining three projects to the five employees.
Subtracting $\binom{4}{1}3^5$ from $4^5$ subtracts those cases in which two projects are excluded twice, once for each way of designating one of the excluded projects as the excluded project. Since we only want to subtract such cases once, we must add them back. There are $\binom{4}{2}$ ways to exclude two of the projects and $2^5$ ways to assign the remaining two projects to the five employees.
We subtracted those cases in which three projects are excluded three times when we subtracted those cases in which one project was excluded, once for each way of designating one of those projects as the excluded one, then added them back three times when we added those cases in which two projects are excluded, once for each of the $\binom{3}{2}$ ways of designating two of those three projects as the excluded ones. Therefore, we have not excluded them at all. Hence, we need to subtract the $\binom{4}{3}$ ways we could exclude three of the projects.
By the Inclusion-Exclusion Principle, the number of ways we can assign four projects to five employees so that each employee does one project and every project is assigned to at least one employee is
$$4^5 - \binom{4}{1}3^5 + \binom{4}{2}2^5 - \binom{4}{3}1^5 = 1024 - 972 + 192 - 4 = 240$$
Observe that we can write the answer in the form
$$\sum_{k = 0}^{4} (-1)^k\binom{4}{k}(4 - k)^5$$
where $\binom{4}{k}$ represents the number of ways $k$ of the $4$ projects can be excluded and $(4 - k)^5$ is the number of ways the remaining $4 - k$ projects can be assigned to the five employees.
In how many ways can $m$ employees be assigned to $n$ projects, with $m \geq n$, if each employee is assigned to one project and each project is assigned to at least one employee.
By the Inclusion-Exclusion Principle, the number of ways $n$ projects can be assigned to $m$ employees if each employee is assigned one project and every project is assigned to at least one employee is
$$\sum_{k = 0}^{n} (-1)^k\binom{n}{k}(n - k)^m$$
For your second problem, $m = 6$ and $n = 3$.
Why were your attempts incorrect?
Let's consider the case in which five employees are assigned to four projects. Say the employees are $A$, $B$, $C$, $D$, and $E$. Suppose $A$ and $B$ work on one project and the other employees each work on a different project. You counted this case twice, once when you designated $A$ as the person assigned to the project and $B$ as the additional person and once when you assigned $B$ as the person assigned to the project and $A$ as the additional person. The same argument applies to all the possible assignments. Hence, you counted every case twice. Notice that $2 \cdot 240 = 480$.
For the second problem, let's refer to quasi's helpful answer.
You counted distributions of the form $4, 1, 1$ four times, once for each of the four ways you could have designated one of the employees as the person assigned to the project with four people and the others as the additional people.
You counted distributions of the form $3, 2, 1$ six times, once for each of the three possible ways to designate one of the three people as the person assigned to the project with three people and the others as the additional employees and once for each of the two ways to designate one of the two people as the person assigned to the project with two people and the other as the additional employee.
You counted distributions of the form $2, 2, 2$ eight times, once for each of the two ways you could have designated one of the two people assigned to each project as the person assigned to that project and the other as the additional employee.
Notice that $4 \cdot 90 + 6 \cdot 360 + 8 \cdot 90 = 360 + 2160 + 720 = 3240$.