To Live in Lugano
Yes. Please read the information available on the USI website carefully.
This link also contains plenty of other helpful information.
To Live in Erlangen
The need for a residence permit depends on the citizenship of the student. More detailed information can be found on the FAU website.
Please read the information carefully.