The father of a school friend was a shipwright at a yard in Scotland. He said he knew the difference, but it was a secret that he'd let us know - sometime! After many years, he told us.
'Ships have more than one deck.' And that's it. A boat will have either only one deck or no deck.
Before you all go screaming off about that not being right, let me explain that in the past, by tradition, marine and naval architects went out of their way to comply with this rule. There may appear to be several decks on a vessel called 'a boat', but if you consulted the plans you'd see that they weren't called 'decks', but something else. My earliest experience of this was visiting the lower 'deck' on a motor torpedo boat, when I was told off that it wasn't a 'deck', it was the 'tanktops'.
On cargo vessels, any deck only qualifies as a true deck if there are watertight bulkheads beneath it.
These days, sadly, that 'boat v ship' rule seems to have been forgotten. I've seen the 'levels' on older oilfield supply vessels become 'decks' on the newer vessels. Maybe the old-timers should have been less secretive about the difference between 'boat' and 'ship', to ensure that the tradition continued.