su is used to launch a root shell that allows all further commands to use root access. su has no -u option...
https://man7.org/linux/man-pages/man1/su.1.html
This is why it is saying/complains;
Try 'su --help' for more information.
You would need to add user1 to the wheel group, then as Bodo points out, execute;
sudo -u user2 passwd
It's clear to me that sudo is your intended use here, as you are trying to execute a single command with temporary privilege elevation. (which is what sudo is for).
However, for completeness and as user Bib points out, you could execute;
su - _user_ foo
...which would allow you to run as root for another user.
This is the 'login shell' option for su (-, -l or --login). This is also handy for granting root privileges in the scenario, where the user doesn't have sudo privileges (and where the admin don't want them to, either.).
sudoandsu. These two programs have different command line syntax and slightly different purpose. Do you meansudo -u user2 passwd?sudo -u user2 passwd. By the way, can you please help understand difference betweensudoandsu?