Taking those in order.
The primary-residence exclusion attaches to ownership and use of a home rather than to your occupation, so a license by itself doesn't disqualify you. Where the dealer question gets real is when the pattern of activity suggests you're holding property as inventory, and a genuine 24-month occupancy in each house is the strongest fact against that reading. One at a time, four in eight years, actually living in each, is a very different fact pattern from three concurrent renovations. How any of it applies to your specific returns is a question for a CPA who has seen your filings, and I'd raise it before the first purchase rather than in the year you sell.
The frequency rule matters more to your plan than the dealer question does. The exclusion generally can't be used more than once in a two-year period, so back-to-back sales with any overlap will cost you one of them. Four sales in eight years leaves you almost no slack. Plan closing dates deliberately.
On disclosure, most states require a licensee to disclose licensed status in a transaction where they're a principal, and many impose the same honesty and material-defect duties on you as a seller that you'd carry representing someone else. The specifics differ by state, so read your own commission's rules rather than a general summary.
The unpermitted work is your real exposure, and it doesn't need a license to hurt you. Self-performed electrical or plumbing you can't document, discovered by a buyer's inspector, becomes a disclosure question, a possible retroactive permit, and in some states a claim window that stays open for years after closing. Holding a license raises the standard a regulator or a jury will hold you to. Pull permits on anything structural, electrical, gas, or plumbing, and keep the inspection cards.