The information provided by the above 2 persons may or may not be correct.
I personally encountered similar issues during my N400 interview. To better explaining my situation, I have included my timeline below:
While on H1b non-immigrant visa: I travelled outside of US for a few days in October and November of 2016
GC approved on Dec 20, 2016
Oct 1, 2021: 90 days early filing for N-400 (5 years rule)
On my N400 form, I did NOT include my trips in Oct and Nov 2016. I only included all trips after Dec 20, 2016.
During the interview, the officer found out about my trips in Oct and Nov 2016. The officer made it clear that I must include all trips 5 years before the date I filed for my N400 - regardless of my immigration status at that point (so in my case, any trips between Oct 1, 2016 - Dec 20, 2016 must also be included).
Now, I do not know how B visa will come into play. To be safe, I would include all trips during that timeframe, then explain to the officer during your interview, and correct/amend your form if necessary.
I also have a friend who will likely run into similar question, he went from F visa (student) to GC via marriage, then recently applied for N400 (3 years rule), he travelled outside of US quite often within 2 years leading to his GC, while he was on F visa. I will update this post if I hear anything from him.