Placeholders for Referencing Hierarchical Figures

I returning to Scrivener after not using it for years. I am writing a non-fiction manuscript and have questions about placeholders.

My document has several hierarchical figures. Here is an example:

Figure 5.<$n>. Figure Name
<$sn>. Example 1

<$sn>. Example 1

How can I refer to these figures in the text as Figure 5.1 and 5.2? For example, “In figures 5.1.1 and 5.1.2, text, text” rather than “figures 1 and 2” as they are currently presented.

Also, is there anyway to keep figure name, figure, and source as one unit?

When I compile it, sometimes one or more element spills to the next page. I’ve attempted more advanced placeholders to get the formatting required for my manuscript, but have been unable to replicate some of the suggestions on the forum. For example, I tried to use <$hn> rather than <$sn> but the numbering system restarted with each figure as well as adding keywords. What am I missing?

If it is useful to answer my question, I am using a blank document that I have formatted myself in accordance to the publisher’s requirements.

Thank you