I am trying to create custom TextInputLayout. How can I create below custom TextInputLayout?

You should use Material Design style for Outline Box. Just simple use:
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
in TextInputLayout. See Text Field for Android in Material Design Guide