If you want to upgrade via UA, you can see your options here:
https://www.united.com/web/en-US/con...rade/saua.aspx
According to the website above, codeshare flights are not eligible. So they would have to be booked as LH flights in order for you to be able to upgrade them using UA MP