If you are growing herbs using artificial light as an only source, they should have about 14-18 hours of light. Remember, plants that aren't actively growing don't need fertilizer, but plants in bloom do. Herbs also need good drainage. If your soil is mostly clay and holds water, you will need to amend it with plenty of compost and sand. If your soil is sandy it will need compost for it's nutrient value.
Most herbs thrive in a neutral to slightly alkaline soil.
You may want to do a pH test of your soil to see if it needs adjustments. Rosemary is native to the Mediterranean region and loves dry, sunny locations. Most homes don't provide ample light for rosemary to thrive. It needs at least 6 hours of strong sunlight or 14-18 hours of artificial light daily. Rosemary loves air circulation and doesn't like to be crowded, so leave ample space for breathing room.