Comparing basic strength order of amines
You don't have problem with assigning compound IV (1, 4, 5, 6- tetrahydropyrimidine) as the most basic compound among given four amines. I agree with you, but not the same reasons. According to Ref.1, the 1,4,5,6-tetrahydropyrimidines (THPs) are extremely basic compounds, as might be expected from their amidine structure (e.g., 1,8-Diazabicyclo[5.4.0]undec-7-ene or DBU). The parent THP, 1,4,5,6-tetrahydropyrimidine (IV) has a $\mathrm{p}K_\mathrm{a}$ of about $13$ at $\pu{20 ^\circ C}$, which is even reacted with water (Ref.1). This highly basic nature of IV can be attributed to its stabilization by resonance between two equivalent structures, V and V', when protonated: 



Also, keep in mind that it can also get protonated on 3-nitrogen atom (VI; inside the blue box) as well (Ref.1).

Among the rest of other 3 amines, two are aminopyridines (I and II), and the third one is aniline (III). Since the lone pair of nitrogen in pyridines does not contributed to aromatic system (hence it is readily available for proton) while that of aniline is involved in aromatic system by resonance (not readily available), generally pyridine is more basic than aniline. Even though I and II both have extra amino group, they are expected to behave like pyridines. By this analysis, we can conclude that the least basic amine among given four amines is aniline (III).

Now, let's look at what happens when I (4-aminopyridine) is protonated:



From above illustration, you can clearly see conjugate acid of I is well stabilized by resonance including full contribution of the lone pair of 4-amino-nitrogen. If you visualize the same with II (3-aminopyridine), it is not stabilized by the extra amino grop as depicted in following diagram:



Thus, by these facts, we can conclude that II is less basic than I. Therefore, the order of basicity strength of four given amines is: IV > I > II > III.

References:


D. J. Brown, R. F. Evans, “100. Hydropyrimidines. Part I. 1, 4, 5, 6- Tetrahydropyrimidine and its derivatives,” Journal of the Chemical Society 1962, 527–533 (https://doi.org/10.1039/JR9620000527).