PatternCount - will count the number of occurrences of the search string that is in the text. In your example the word "List" would be searched in the variable $layout and display the number of times List appears in that variable.
PatternCount ( "AppleOrangeKiwi" ; "Apple" )
will return the value 1 because the text "apple" appears once in the first string.
Patterncount ( "applesauceAppleOrangeKiwi" ; "apple" )
would return the value 2 and shows where care must be taken when using this function. If $List is a return separated list of values as is often the case thanks to checkbox formatted fields, ExecuteSQL queries, the List() function, "List of" summary fields...,
Then the filtervalues function is a better option to use in place of patterncount in most cases.
Both functions can be researched in FileMaker Help in order to learn more.