After checking the source code the problem is related to outcome:
the com.sun.faces.flow.FlowHandlerImpl.getFlow method need Id to be not null:
public Flow getFlow(FacesContext context, String definingDocumentId, String id) {
Util.notNull("context", context);
Util.notNull("definingDocumentId", definingDocumentId);
Util.notNull("id", id);
The com.sun.faces.application.NavigationHandlerImpl:
result.isFlowEntryFromExplicitRule = null != fh.getFlow(ctx, toFlowDocumentId, outcome);
So the outcome is null and exception is rised. In my case I don't have outcome.
If is needed from-outcome then in some place has to be ejecuted an action. To accomplish that the login.xhtml page need a f:viewAction.
Implementing all this now my the requested use case is working well. If from-action is declared then the from-outcome is optional and vice versa.
If the same logic of redirection is required when user go to root folder (domain/appname/) the only thing that has to be done is to add welcome-file to web.xml.
<welcome-file>login.jsf</welcome-file>
Finally this is the navigation rule declaration
<navigation-rule>
<from-view-id>/login.xhtml</from-view-id>
<navigation-case>
<!--optional<from-action>#{bean.loggedInNavigationRuleAction}</from-action>-->
<from-outcome>logged</from-outcome>
<if>#{identity.loggedIn}</if>
<to-view-id>/home.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
And this has to be added to login.xhtml
<f:metadata>
<f:viewParam name="x" value="#{bean.x}"/>
<f:viewAction action="#{bean.loggedInNavigationRuleAction}" phase="APPLY_REQUEST_VALUES"/>
</f:metadata>