

My passport expires May 2, 2020
Hello,
I have 2 trips planned (Nov. 22-25 and Dec. 31-Jan 1) in which I will be visiting Shanghai and Chengdu. My first question is regarding when my passport will expire. I read that 3 months before expiration is required but I also see advice that I need 6 months to expiration. If 6 months, then both of my trips would not be eligible. I would only have a little over 5 months and then 4 months. Please tell me if 3 or 6 months validity is required on my USA passport.
Trip 1: Fly from Newark (USA) to Shanghai, arriving Nov. 22, 2019, stay 2 days, fly to Chengdu for 11 hours layover and then fly to Vietnam on Nov. 25.
Trip 2: Fly from Narita (Japan) on Dec. 31 to Shanghai, fly to Newark (USA) on Jan. 1, 2020.
Aside from my passport expiring, do both of my trips qualify for Visa Free Transit in China?
Thanks!