In order for your test rule above to work, it must be installed in the .htaccess file which will be accessed when the URL [
user...] is requested, and because of your end-anchored pattern, it will work *only* for the exact URL-path "/user" -- if anything else follows "/user" then the rule won't be invoked.
You also need to delete your browser cache every time after making *any* change to server-side code, whether that be in a config file, .htaccess file, script, html page, css, JS file, etc. Forcing a page reload may not be sufficient due to different browser caching implementations, so I suggest that you completely delete the cache.
You're asking about the $1 back-reference in the rule I posted. This $1 refers to the matched contents of the first (outer) parenthesized sub-pattern in the RewriteRule pattern. Therefore, in my code, the requested URL-path starting with "/user" or "/admin" and including anything that follows it, is 'copied' from the http URL into the https URL, so that only the http/https protocol is changed by the redirect -- The originally-requested URL-path is retained.
However your question also implies that you have not read the Apache mod_rewrite documentation at apache.org, and I should warn you that using mod_rewrite without doing so can have serious detrimental effects on the healthy operation and search rankings of your site. This is server config code, and should not be trifled with.
Jim