Going off your itinerary, you'd be looking at:
Newark to Dublin - immigration/customs*
Dublin to Paris - immigration/customs*
Paris to Rome - no immigration/ no customs
Rome to London - immigration/ no customs
Edinburgh to Rome - immigration/ no customs
Rome to Newark - looonger immigration/customs ;)
*depending on flight bookings
Is the Newark (to Dublin, then on) to Paris a single booking? Or did you book two entirely separate flights? That's more relevant to customs than it is immigration, because that'll determine what your luggage is up to. If you booked two entirely separate flights, you'll likely need to retrieve your luggage and clear both customs and immigration in Dublin, then re-check the luggage for the flight on to Paris. If it's a single booking, you'll check your luggage in Newark and not see it until Paris (and clear customs there). Keep in mind customs and immigration are two distinct things - immigration is, in a nutshell, down to your passport and you as a person, customs about your luggage and whatever items you're traveling with.
Ireland isn't a Schengen area country, which means you'd not only go through immigration once arriving from the US and leaving the airport, but again once arriving in Paris from Dublin. Having said that, immigration is often simple enough once there and you're looking at mostly a customs-free zone throughout the EU.
Once in Paris and traveling on to Rome, you might as well be on a domestic flight as both France and Italy are Schengen area and don't require passport control to travel between them. Ireland and the UK are not Schengen. But that means, when traveling back to London from Rome, you're traveling back out of Schengen, then back in once heading back to Rome. You sure have quite the itinerary!
https://www.ricksteves.com/travel-tips/trip-planning/travel-documents
Has more info on Schengen (scroll down a lil ways).