It would be great, if i could set up rule conditions
1. has parent (so that would fit any page or hierarchical CPT that has parent). and of course it could be combined with e.g. post type rule to fit childs of some custom post type
2. has child – very similar, just matches only pages or hierarchical CPT, that has any child
3. parent level – sometimes some fields are only needed e.g. for the second level pages/cpt
4. currently there is only one parent related rule – if the parent is some page. Problem is, that it does supports only post_type=page, not any other hierarchical CPT – this is IMO more a bug then feature request
To do this you need to create custom location rules.
I do not have existing code for exactly what you are looking for. There are many examples of doing this on the web, but not exactly this.