We can think to this "scheme": you have five ordered empty "boxes" and each of them has to be filled with one digit from $0,\ldots,5$ (which are $6$ "objects") with no repetitions, in order to get a $5$-digits number. This means that the last two digits must form a number which is divisible by $4$; then the possible last two digits are as follows: $04$, $12$, $20$, $24$, $32$, $40$, $52$. Now, take for instance $04$; how many numbers (strings) of five distinct digits ending with $04$ are there? Since the last two digits are taken, we have to choose the first three among the remaining ones, that is we have to choose and order $3$ objects out of the $4$ left: this means we have $D_{4,3} = 4 \cdot 3 \cdot 2$ such strings. The same reasoning applies to $20$ and $40$, but not to $12$, $24$, $32$ and $52$: in these cases, in facts, for the remaining three digits $0$ is available but cannot be chosen as first digit, since we want $5$-digits numbers. Thus, in these four cases, the first digit can be filled in $3$ ways (and not $4$, because $0$ is also excluded), the second in $3$ ways and the third in $2$, giving $3\cdot 3\cdot 2$ possible numbers for each couple of final two non-zero digits. Hence, since for $04$, $20$ and $40$ (which are $3$ "cases") we apply the first reasoning, and for $12$, $24$, $32$ and $52$ ($4$ "cases") the second one, the total amount of numbers of five distinct digits (chosen among $0,\ldots,5$) that are divisible by $4$ is $$3 \cdot (4 \cdot 3 \cdot 2) + 4 \cdot (3 \cdot 3 \cdot 2) = 144.$$
The hints in the comment section provides valuable insights to the problem.
I will write a complete answer just to be sure you understand the hints.
There are $3$ cases whereby the sum of the $4$ digits is even,
(1) All $4$ digits are odd.
(2) All $4$ digits are even.
(3) $2$ digits are odd and $2$ digits are even.
First, note that there are $4$ odd digits and $3$ even digits in the set $\{1,2,3,4,5,6,7\}$.
Let's start with Case (1).
Since each digit can only be chosen once, there is $4$ ways of choosing the first odd digit from $\{1,3,5,7\}$,
followed by $3$ ways of choosing the second odd digit from the remaining $3$ digits,
followed by $2$ ways of choosing the third odd digit from the remaining $2$ digits,
followed by $1$ way of choosing the forth odd digit from the remaining $1$ digit.
So, there are $4\times 3 \times 2\times 1 = 4!$ possibilities for Case (1).
Now on to Case (2),
there are $3$ even digits in $\{1,2,3,4,5,6,7\}$, namely $2,4,6$.
Remember that the $4$ digit number must contain different digits, we cannot use either $2$, $4$ or $6$ more than once to construct the $4$ digit number.
And furthermore, there are only $3$ even digits available, so it is impossible to construct any $4$ digit number with no repetition of a digit.
Hence, there is $0$ possibilities for Case (2).
Finally, let's move on to Case (3), which is slightly more difficult.
We first do an unordered selection of $2$ odd digits from $\{1,3,5,7\}$.
which gives $\binom{4}{2}$ possibilities,
followed by an unordered selection of $2$ even digits from $\{2,4,6\}$.
which gives $\binom{3}{2}$ possibilities.
An example would be choosing the digits $1, 5, 2, 4$.
We can quickly see that a valid $4$ digit number would be $1524$.
Note that other permutations of the $4$ digits also form a valid $4$ digit number,
example, $5124$ and $1542$.
and, there are $4!$ permutations in total.
So, by the product rule, there are $\binom{4}{2} \times \binom{3}{2} \times 4!$ possibilities.
Finally, by sum rule, there are a total $4! + 0 +\binom{4}{2} \times \binom{3}{2} \times 4!$ possibilities for the $3$ mutually exclusive cases.
Best Answer
You are wrong in assuming that even numbers can't be divisible by 3. As a counter example, 6 is divisible by 3.
The divisibility rule for 3 states that the if the sum of the digits of the number is divisible by 3, the number itself is divisible 3.
Out of the seven digits given, you need to find groups of 5 for which the sum is divisible by 3. For example, $(1, 2, 3, 4, 8)$ is one such group. For every such group you need to find the number of 5 digit numbers that can be formed and get the total.