Ihr is for plural and Du is for singular. Both are informal. The formal You is Sie (always capitalized).
Does it matter when you use Ihr and Du? Also...... how do you know? The guy who answered first told me something different. So how do you know that ihr and du are informal and sie is formal
In the first lesson (basics) there are some tips and it says the difference between them.
If you are talking to just one person you should use Du. You should use Ihr when talking to many people. It doesn't matter which you use on Duolingo.