Whatever you care about. I typically put the mainline operating carrier. In the scenario you describe that would be United. If I was on a UA codeshare operated by Lufthansa Cityline I'd just do Lufthansa, even though the flight is marketed by United and operated by Cityline.