Modify pwpolicy in Sierra
Ok, this is how I finally resolved it, though I am not sure if it is the properest way.

As @patrix pointed out, pwpolicy setaccountpolicies requires for the path of a XML file with the policies.

pwpolicy getaccountpolicies gives the current global policies in XML format, so I redirected the output to a file with
pwpolicy getaccountpolicies &gt; file.plist , removing the possible info messages the command might write and leaving only the XML structure.

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;policyCategoryPasswordChange&lt;/key&gt;
    &lt;array&gt;
    ...
    &lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Then I changed the value I wanted to modify in my case, in the file I created (file.plist):

&lt;key&gt;policyIdentifier&lt;/key&gt;             
&lt;string&gt;ProfilePayload:[HASHED_VALUE]:pinHistory&lt;/string&gt;           
&lt;key&gt;policyParameters&lt;/key&gt;             
&lt;dict&gt;
  &lt;key&gt;policyAttributePasswordHistoryDepth&lt;/key&gt;
  &lt;integer&gt;2&lt;/integer&gt;             
&lt;/dict&gt;


Finally I used that file to update the policy:
pwpolicy setaccountpolicies /path/to/file.plist