I recently stumbled upon the notation $d^2N = dn\,dV$ in physics classes. Someone told me that it's a second-order differential element because it's a product of two differential elements, hence the notation $d^2$
Is this related to the notation used for second order derivatives $\frac{d^2f}{dx^2}$ ?
Also, I'm confused about differentials properties:
if $z = xy$
$dz = d(xy) = x \, dy + y \,dx$
but $d^2z = dx \, dy$
How does it work, i'm lost...
No, it is not related. The first is a volume, or rather surface element, so the exponent $2$ denotes the geometrical dimension. For the second order example the $2$ means a two times application of a differentiation operation.
About the properties: The first one is an example of the differentiation rules. The second one, again, is preparing a volume or surface element for an integration of some sorts.
You will encounter the use of differentials combined with different mathematical rigour: they are defined precisely in differential geometry or non-standard analysis. Otherwise I personally consider them a helpful notation, for example when using separation of variables - the precise definition is much more unwieldy.