As of writing this and in hopes of not wasting potentially hundreds of hours of technicians time around the world, this documentation is amazing, yet should probably include that the -MembershipRule options are only available in the AzureADPreview module. Yes, that's right, almost 6 years later and you still can't make a dynamic group with rules using AzureAD module.
I know that the article references the AzureADPreview module, but I have had several people run into the problem because the official documentation on docs.microsoft.com doesn't mention that you need to use the preview module.
If you have run into this problem, you can install the preview module like this:
#It can be install alongside the other module
Install-module AzureADPreview -Repository PSGallery -AllowClobber -Force
#if you have both modules, you should ensure that the correct module is the one you are using:
# Unload the AzureAD module (or continue if it's already unloaded)
Remove-Module AzureAD -ErrorAction SilentlyContinue
# Load the AzureADPreview module
Import-Module AzureADPreview
I know the post is old, but it scores really high in google searches for creating a dynamic group. If my reply here helps even one person, it was worth the time writing it.