As long as the property owner owns and occupies the property, they can do the work themselves. They have to get the proper permits.
Exceptions
Any air conditioning work involving freon requires that the property owner have an EPA card to do the work themselves.
CSST-any work using flexible gas piping, the homeowner must have certification in this particular brand to install themselves.
Homeowner can do the work if it is using black iron pipes, which is the standard.