Unfortunately, retinoids (and retinols), the Vitamin A-derived holy grail ingredient that works wonders on both acne and fine lines by promoting skin-cell turnover, are considered unsafe to use during pregnancy. Those molecules have pretty good data showing that they can affect embryo development in the first trimester.
Even though most of the studies were done when the medication is taken orally, we believe that it is absolutely contraindicated to use any cream or lotion with those ingredients at least during the first trimester. But I generally say avoid it during all of pregnancy.
For breastfeeding, the data is less clear, but the dermatologists generally agree that it’s best to avoid oral or topical retinoids and retinols during lactation too. There are no data studying it in lactating mothers and in breast milk, so it’s kind of one of those unknowns. I generally recommend not using it when breastfeeding.
Antioxidant protection using niacinamide, Vitamin C or peptides and moisturisation in the form of hyaluronic acid and SPF protection are all highly recommended in pregnancy to avoid issues like melasma and chloasma if acne becomes a problem azelaic acid is also very beneficial.