Change Node Owner On Node Submit
hook_form_FORM_ID_alter is used to alter the form before it is rendered, if you want to alter the form after being submitted and before being save, you have to use hook_node_presave.
Put this code in a custom.module:

function custom_node_presave($node) {
  if ($node-&gt;uid == 0) {
    // Change anonymous node author to uid: 2
    $node-&gt;uid = 2;
  }
}