More precisely: the first letter of a name is always capitalised.
So in "Hans de Zwart", the 'H' is the first letter, and therefore capitalised. But in "De Zwart", the 'D' is the first letter, and therefore capitalised, even if it normally wouldn't be.
There might be an exception to that if that letter is not part of a whole word. "De" is a word, but I once knew a guy whose last name was 't Zet. The "'t" is not a word (it's short for "het", the neutral version of "the", whereas "de" is gendered[0]), so probably wouldn't be capitalised[1]. Now imagine 200 countries and languages with exceptions like that and imagine having to write software to handle all of that correctly. This stuff was never a problem before the internet, but I expect the next century is going to see a lot of simplifications in language.
[0] Yeah, in Dutch, there are two articles: "de" which is gendered, and "het" which isn't. Compare to French "le" and "la", which are both gendered, one male and one female, and there's no neural article. In Dutch there is, but the gendered article doesn't care whether it's male or female; it works for both and doesn't actually care about gender, just that it's there. So it's gendered in a neutral way. Wrap your head around that.
[1] This is also true at the start of a sentence: always capitalised, except when it's not a complete word. If you start a sentence with 's avonds ("in the evening), you capitalise the 'A', not the 's', which is actually the last letter of the archaic possessive 'des'.