Allow a user to manage his/her own users and be able to assign roles I need to give access to a specific user with a specific role to be able to give the user role but not the administrator 

My case is that the website I'm building needs different kinds of admins and roles, for the role I need to find a solution is for a sub-admin this person should be able to add users and assign roles and I also want this person to only be able to manage the users he adds not all the users. 

I found that by using flags and roles might be the best way I found this answer to the question "Give a specific user role the ability to give a user a role but not the &#39;administrator&#39; role". My problem is that I'm not proficient in Drupal and I'm not sure what to add in this window https://pasteboard.co/H7E7rX9.png I'm trying to learn more about rules seeing that probably I'll be using more of this on my project 

Thank you so much for your help.
Have a look at the Group module (commonly perceived as an alternative for Organic Groups).

Group allows for creating arbitrary collections of your content and users on your site, and grant access control permissions on those collections. It is available as of D7, and has a D8 version also. The Group module creates groups as entities, making them fully fieldable, extensible and exportable. Which also makes it integrate very well (out of the box) with commonly used modules such as Rules, Views, etc.

The way you described in your question how you imagine using the (great!) Flag module, translates more or less to "Is user X yes or no member of Group G?" combined with "What group roles does this user have". However, after you will understand / realize all the things you can do with the Group module (with zero custom code ...), you'll probably also understand that trying to do something similar with the Flag module, is going to take a lot of flags, and related Rules logic.

More info

Some more questions you may want to look at for more details:


How to configure access to courses for teachers and students?, which contains a sample configuration.
What are the various roles supported by the Group module?, which explains the various types of roles that can be used. 
How to bulk assign existing content to a group created with the Group module?, a typical issue when adding this module to an existing site.
What are the features of the Group module versus Organic Group module?


Resources


Community documentation for the Group module.
Video tutorial "How to use the Group module in Drupal 8 to manage editorial access control to different areas of a web site".