I would not take a 4-year-old & 1-year-old to Lecce. When you get that far south in Italy the tourist infrastructure is just not there. Public transportation is not easy. We had to go to three different ticket offices to find the one selling train tickets to Gallipoli. I can’t imagine doing that with 2 small children. And the beaches I saw near Lecce are not the gorgeous white sand you find further north along the Adriatic.
My first choice for you would be Senigallia, further north, in Le Marche. This is a lovely small community bordering miles of flat sandy beaches. The sea is very shallow for a long ways out and there are no big waves, so it’s perfect for children. There are hotels along the beach with enclosed playgrounds on the sand. I don’t know if these are open in May, or if any of them are apartments , but they would be ideal. Senigallia Is a very walkable place, where you could get by without a car. The town has daily markets, a fort to explore, and even nearby Caverns of Frasassi, which may be fun for your 4-year-old. Senigallia is well -connected by train & bus.
Another option would be to stay at a masseria, which is similar to an agriturismo in the rest of Italy. We stayed at one not far from Bari in Puglia. It had a shallow swimming pool, goats and other animals, and lots of fruit trees. You’d pretty much need a car, but the driving is easy. You could fly into Bari or Brindisi & rent your car. Then you could take little day trips to the trulli villages and to the sea — there’s a marine preserve along the coast. On a masseria the kids could run and explore and yet you’d be close enough to Monopoli and other cities for you to enjoy. The masseria we stayed at had a communal kitchen , well stocked, so you could feed the children dinners at home.